Re: Not Looping...
| From: | Chris Lee | Date: | Thu, 15 Mar 2001 16:07:40 +0000 |
| Subject: | Re: Not Looping... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-44087@lists.php.net to get a copy of this message | ||
this question was answered be me only two days ago. it would be nice to see people checking before
they post.
<?php
$db = mysql_connect('localhost', 'root', '*****');
mysql_select_db('indywebdesign', $db);
$query = 'SELECT * FROM invoices WHERE customerid = $id ORDER BY invoiceid DESC';
$invoices_result = mysql_query($query);
while($result = mysql_fetch_array($invoices_result))
$invoices[] = $result;
?>
--
Chris Lee
lee@mediawaveonline.com
""WreckRman2"" <wreckrman2@combatfs.com> wrote in message news:MABBLAPKMKCPAFPFGAJKIEAOCMAA.wreckrman2@combatfs.com...
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>
--
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