create an html table from mysql db

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 824
Joined: Sun Jun 02, 2002 3:09 am

Thu Oct 17, 2002 10:35 am

$query=mysql_query("SELECT * FROM `table`");

echo "<table width=800 border=0>";
echo "</table>";


Fri Oct 18, 2002 1:16 am

We will help you with your scripts, but not write them for you! Pejone's solution is the standard method.

Begin your table as normal (heading cells etc), then call the results as a row. For every row print a row in your table containing the results, and then end the table, voila!

If you can't structure the query correctly, then try to make it into an array and use this array to generate the table. It's all about learning how to use loops and generate a table row each time!

Post Reply