You are here: Display sql query output in html table « PHP Programming Language « IT news, forums, messages
Display sql query output in html table

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация