> I am a newbie at this and I cannot find the damn answer to it!  I want
> to display the table in an html format with PHP but I cannot get it to
> work!  With MS SQL Server it was sooo easy!  With PHP and mySQL it's a
> pain in the butt!  I cannot find any documentation on this and I order 3
> books on this stuff, but they won't be here till at least Monday.

<?
$dblink = mysql_pconnect("localhost", "username", "password");
mysql_select_db("database");
echo("<table>\n");
$res = mysql_query("SELECT * FROM table");
while ($row = mysql_fetch_array($res, MYSQL_ASSOC)) {
  echo("<tr>\n");
  foreach ($row as $col) {
    echo("\t<td>$col</td>\n");
  }
  echo("</tr>\n");
}
echo("</table>\n");
?>

http://www.php.net/manual/en/html/ref.mysql.html

Doesn't seem so hard to me...

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to