On Thu, 15 Mar 2001 17:48, WreckRman2 wrote:
> I am having problems figuring out how to loop to show more then one
> record... Any help would be great... All I can get is the first
> record...
>
> Thanks...
>
> Code:
>
> <?php
>
> $db = mysql_connect("localhost", "root", "*****");
> mysql_select_db("indywebdesign",$db);
>
> $invoices_result = mysql_query("select * from invoices WHERE
> customerid=$id ORDER BY invoiceid DESC");
> $invoices = mysql_fetch_array($invoices_result);
>
> ?>
>
> <TR>
> <TD BGCOLOR="#EAEAEA"><FONT FACE="Tahoma" SIZE="2"><?php echo
> $invoices["date"] ?></FONT></TD>
> <TD BGCOLOR="#EAEAEA"><FONT FACE="Tahoma" SIZE="2"><?php echo
> $invoices["amount"] ?></FONT></TD>
> <TD BGCOLOR="#EAEAEA" COLSPAN="2"><FONT FACE="Tahoma"
> SIZE="2"><?php echo $invoices["description"] ?></FONT></TD>
> </TR>
Check out the example in the manual for mysql_fetch_array, using a while
loop. Also see extracrt to save a bit of typing :-)
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]