Jump to content

creating a table in html


johnnyblaze9

Recommended Posts

just a quick example:

 

<table width="100%" cellpading="0" cellspacing="0" border="0">

<?php
$query = "SELECT Data FROM Main ORDER BY RAND() LIMIT 5";

$result = mysql_query($query, $link)
  or die(mysql_error());

  $main = ' ';
  
while ($row = mysql_fetch_array($result)) {
  $Data = $row['Data'];

  $main .=<<<EOD
     <tr>
      <td>
        $Data
      </td>
    </tr>

EOD;

}

echo $main;
?>

</table>

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.