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
https://forums.phpfreaks.com/topic/225857-select-from-order-by-id-tables/
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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.