Stuck with HTML for MySQL Output

From: Date: Sat, 11 Aug 2001 13:38:01 +0000
Subject: Stuck with HTML for MySQL Output
Groups: php.db 
Request: Send a blank email to php-db+get-11242@lists.php.net to get a copy of this message
Hi I have a very simple query to my mysql dbase which returns the data ok. But I can't get the html to work properly. I can change the bg color, but I can't change the font, or font colour, and can't find anything in my book which will help me. Can anyone help please? Secondly, how do I get Column titles for my database output? I have tried everything and can't work it out. I did put a select x as y from handicap_results in the sql query, but that still only producted the output without any column titles. BTW I am very new to php and sql, have two great book, but I'm having trouble applying basic php theory which I kind of understand when I introduce sql outputs! Here is my script: <? $link = mysql_pconnect ("localhost", "xxx", "xxxx") or exit(); mysql_select_db ("aokcc") or exit(); $result = mysql_query ("select * from handicap_results") or exit (); $num_rows = mysql_num_rows ($result); print "<b>$num_rows games have been played in the League thus far.</b><p>"; print "<table border=1 bgcolor=#000099\n"; while ($a_row = mysql_fetch_row ($result)) { print "<tr>\n"; foreach ($a_row as $field) print "\t<td>$field</td>\n"; print "<tr>\n"; } print "</table>\n"; ?> Thanks in anticipation Regards Sara

« previous php.db (#11242) next »