php-db | 2000121
Date: 12/06/00
- Next message: Fábio Ottolini: "Re: [PHP-DB] Fw: Creating tables on the fly"
- Previous message: Jon McFarling: "[PHP-DB] Fetching into an array in MySQL"
- Maybe in reply to: Jon McFarling: "[PHP-DB] Fetching into an array in MySQL"
- Next in thread: Andy Etemadi: "Re: [PHP-DB] Fetching into an array in MySQL"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Did you initialize the counters before the while loop?
$userId = $Lname = $Fname = 0 ;
Anthony
-----Original Message-----
From: Jon McFarling [mailto:mcfa0773 <email protected>]
Sent: Wednesday, December 06, 2000 4:30 PM
To: php-db <email protected>
Subject: [PHP-DB] Fetching into an array in MySQL
I am trying to fetch the data gathered from a query into several arrays
I have tried the following but I lose the first row fetched:
while ($row = mysql_fetch_array($result))
{
$userID[$userId++]=$row["userId"];
$lname[$Lname++]=$row["Lname"];
$fname[$Fname++]=$row["Fname"];
}
to fix this I tried
while ($row = mysql_fetch_array($result))
{
$userID[$userId]=$row["userId"];
$lname[$Lname]=$row["Lname"];
$fname[$Fname]=$row["Fname"];
}
but no data was stored into the arrays
any ideas?
Jon
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Fábio Ottolini: "Re: [PHP-DB] Fw: Creating tables on the fly"
- Previous message: Jon McFarling: "[PHP-DB] Fetching into an array in MySQL"
- Maybe in reply to: Jon McFarling: "[PHP-DB] Fetching into an array in MySQL"
- Next in thread: Andy Etemadi: "Re: [PHP-DB] Fetching into an array in MySQL"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

