Page 1 of 1

[SOLVED] php echo table contents from dtabase

Posted: Wed Jan 27, 2010 1:15 pm
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

Re: php echo table contents from dtabase

Posted: Wed Jan 27, 2010 1:34 pm
by crazymao
nvm, i found my mistake