RE: [PHP] Newbie question about filling tables.

From: Date: Wed, 22 Nov 2000 16:22:40 +0000
Subject: RE: [PHP] Newbie question about filling tables.
Groups: php.general 
Request: Send a blank email to php-general+get-26657@lists.php.net to get a copy of this message
Just put echo or print statement around what you have listed below. print "<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="491" HEIGHT="200">"; while($i=mysql_fetch_array($query)) { print "<TR><TD WIDTH="245" VALIGN="MIDDLE">$Record Name<P>$Some_More_Record_Stuff</P></TD></TR>"; } print "</TABLE>" This should give you an idea. Mike -----Original Message----- From: Angel Behar Rodriguez [mailto:abehar@mail.pacificnet.com.mx] Sent: Wednesday, November 22, 2000 11:01 AM To: php-general@lists.php.net Subject: [PHP] Newbie question about filling tables. Hi, Im running php 4.0.3pl1 in a linux 6.2 box, and I'm trying to "fill" a two column x five row table with a different record each cell, I don't have too much experience with php programming, so I can make the MySql query and fetch the results, but once I start the while($i=mysql_fetch_array($query)) command then I dont' know how to display each record in the cell, hope somebody can help me or give me some ideas. Thanks in advance. The General idea is the following : <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="491" HEIGHT="200"> <TR> <TD WIDTH="245" VALIGN="MIDDLE">Record 1 <p>$var1 ; $var2, $var3&nbsp;</p> </TD> <TD WIDTH="4" VALIGN="MIDDLE"></TD> <TD WIDTH="242" VALIGN="MIDDLE">Record 2 <p>$var1 ; $var2, $var3&nbsp;</p> </TD> </TR> <TR> <TD WIDTH="245" VALIGN="MIDDLE">Record 3 <p>$var1 ; $var2, $var3&nbsp;</p> </TD> <TD WIDTH="4" VALIGN="MIDDLE"></TD> <TD WIDTH="242" VALIGN="MIDDLE">Record 4 <p>$var1 ; $var2, $var3&nbsp;</p> </TD> </TR> <TR> <TD WIDTH="245" VALIGN="MIDDLE">Record 5 <p>$var1 ; $var2, $var3&nbsp;</p> </TD> <TD WIDTH="4" VALIGN="MIDDLE"></TD> <TD WIDTH="242" VALIGN="MIDDLE">Record 6 <p>$var1 ; $var2, $var3&nbsp;</p> </TD> </TR> <TR> <TD WIDTH="245" VALIGN="MIDDLE">Record 7 <p>$var1 ; $var2, $var3&nbsp;</p> </TD> <TD WIDTH="4" VALIGN="MIDDLE"></TD> <TD WIDTH="242" VALIGN="MIDDLE">Record 8 <p>$var1 ; $var2, $var3&nbsp;</p> </TD> </TR> <TR> <TD WIDTH="245" VALIGN="MIDDLE">Record 9 <p>$var1 ; $var2, $var3&nbsp;</p> </TD> <TD WIDTH="4" VALIGN="MIDDLE"></TD> <TD WIDTH="242" VALIGN="MIDDLE">Record 10 <p>$var1 ; $var2, $var3&nbsp;</p> </TD> </TR> </TABLE> --------------------------------------------------------------------------- Ing. Angel Behar R. | "The box says : Windows 98, Windows NT or BETTER Tel : (67) 15-15-15 | That's why I installed FreeBSD" --------------------------------------------------------------------------- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#26657) next »