RE: [PHP] Unique Names for Variable in Loop
| From: | Programmer | Date: | Thu, 02 Feb 2006 19:51:54 +0000 |
| Subject: | RE: [PHP] Unique Names for Variable in Loop | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-229755@lists.php.net to get a copy of this message | ||
Oops you might want to increment $x++ after the assignment.
-----Original Message-----
From: Programmer [mailto:prog@aogc.biz]
Sent: Thursday, February 02, 2006 1:49 PM
To: 'Albert Padley'; php-general@lists.php.net
Subject: RE: [PHP] Unique Names for Variable in Loop
$x = 0;
my_name_array = array();
While($row=mysql_fetch_array($result))
{
my_name_array[$x] = $row["last_name"];
}
Jeremy Schreckhise
-----Original Message-----
From: Albert Padley [mailto:apadley@apadley.com]
Sent: Thursday, February 02, 2006 1:15 PM
To: php-general@lists.php.net
Subject: [PHP] Unique Names for Variable in Loop
I must be brain dead today since I can't get my syntax correct.
Simple MySQL query to return a list of last_name. No problem. Each
last name returned needs to be assigned to a unique variable like
name1, name2, name3, etc.
Somebody just kick me in the right direction.
Thanks.
Al Padley
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php