Hello PHP experts
I have a table of about 2000 categories in a MySQL database in two columns
"id" and "Description"
I am using the code below to bring the list back into a browser for clients to view.
Problem with this code is it only gives me a single column list of the category on my php page..
I need my code to get the single column of 2000 items listed under "Description" in my
database and to display it as a multi column php page.
Any code change ideas to achieve this?
As always any assistance is greatly appreciated.
Best Regards Hoppy
<?php
//connect to database using the mysql_connect function()
$db = mysql_connect("localhost","root",""
;
//Select the database
mysql_select_db("quotesplease3" ,$db);
//Create a query string and SQL statement
$sqlquery = mysql_query("SELECT * FROM category ORDER BY Description" ,$db);
//Build table
echo ("<table border ='0'"
;
//fetch the next row from the query and store it in an array
while ($tablerows = mysql_fetch_row($sqlquery))
{
//Insert data from database into table
echo("<tr><td>$tablerows[1]</td></tr> "
;
}
//close the database
echo "</table>";
?>
</html>
I have a table of about 2000 categories in a MySQL database in two columns
"id" and "Description"
I am using the code below to bring the list back into a browser for clients to view.
Problem with this code is it only gives me a single column list of the category on my php page..
I need my code to get the single column of 2000 items listed under "Description" in my
database and to display it as a multi column php page.
Any code change ideas to achieve this?
As always any assistance is greatly appreciated.
Best Regards Hoppy
<?php
//connect to database using the mysql_connect function()
$db = mysql_connect("localhost","root",""

//Select the database
mysql_select_db("quotesplease3" ,$db);
//Create a query string and SQL statement
$sqlquery = mysql_query("SELECT * FROM category ORDER BY Description" ,$db);
//Build table
echo ("<table border ='0'"

//fetch the next row from the query and store it in an array
while ($tablerows = mysql_fetch_row($sqlquery))
{
//Insert data from database into table
echo("<tr><td>$tablerows[1]</td></tr> "

}
//close the database
echo "</table>";
?>
</html>