[SOLVED] php echo table contents from dtabase

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
crazymao
Forum Newbie
Posts: 14
Joined: Sun Aug 02, 2009 1:56 pm

[SOLVED] php echo table contents from dtabase

Post by crazymao »

ok so i have a script which takes info from a sql databse and outputs it in a table but the problem is that my code only outputs the first result in the table and everything else outside of it. how can i make it so that it outputs it all in the table?

Code: Select all

while($row = mysql_fetch_array($result))
  {
  echo "<td>" . $row['row1'] . "</td>";
  echo "<td>" . $row['row2'] . "</td>";
  echo "<td>" . $row['row3'] . "</td>";
  }
there are multiple entries in each row and only the first ones are put in the table

thanks
Last edited by crazymao on Wed Jan 27, 2010 1:34 pm, edited 1 time in total.
crazymao
Forum Newbie
Posts: 14
Joined: Sun Aug 02, 2009 1:56 pm

Re: php echo table contents from dtabase

Post by crazymao »

nvm, i found my mistake
Post Reply