Jump to content

SELECT * FROM ORDER BY id Tables


Bradley99

Recommended Posts

Hi ho, I am trying to assemble a table so that it shows article in order by id descending. The current one i am using is working but not displaying as i hoped, i need them aligned on the left and right, so id=1 align left, id=2 align right etc. Here's my current code

 

<table style='table-layout:fixed' align="center" cellpadding="2" cellspacing="0" colspan="" class="Main"><br>

<?
$select_paper=mysql_query("SELECT * FROM paper ORDER BY id DESC");
while($the=mysql_fetch_object($select_paper)){
?>
     <tr>
        <td class="subtableheader" width="25%"><?php echo "$the->title"; ?></td>
      </tr>

     <tr>
        <td class="profilerow"  width="100%"><?php echo "$the->news"; ?></td>
        </tr>
     <tr>
        <td class="subtableheader"  width="25%"><?php echo "Article By $the->by - $the->date"; ?></td>
        </tr>

Link to comment
Share on other sites

Hope that fixed your problem.

 

 

 

 

<table style='table-layout:fixed' align="center" cellpadding="2" cellspacing="0" colspan="" class="Main"><br>

<?
$select_paper=mysql_query("SELECT * FROM paper ORDER BY id DESC");
while($the=mysql_fetch_object($select_paper)){
?>
     <tr>
        <td class="subtableheader" width="25%"><?php echo "$the->title"; ?></td><td class="profilerow"  width="100%"><?php echo "$the->news"; ?></td>
      </tr>
     <tr>
        <td class="subtableheader"  width="25%"><?php echo "Article By $the->by - $the->date"; ?></td>
        </tr>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.