|
Posted by Jerry M. Gartner on 06/23/06 18:44
Greetings:
As evident from a previous post, I am a php noob. I would like to
display MySQL query results in an html table with one of the row values as a
category and the rest of the data displayed under the relevant category.
I can get as far as displaying the data in a nice readable format but I
don't know how to have the records placed under their corresponding
category. This is my code thus far (sans the html output):
....ORDER BY cat ASC';
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
printf("%s Class: %s Description: %s", $row["cat"]$row["title"],
$row["desc"]);
}
As you can see, this only outputs each record with the selected rows but
we show multiple instances of the same category. I know why this works the
way it does, I just don't know how to make it work the way I want. Advice
is appreciated. Thanks in advance.
Also, any good links for understanding and using arrays are welcome.
--
Regards,
Jerry M. Gartner
[Back to original message]
|