RE: [PHP] Array problem....

From: Date: Thu, 11 Dec 2003 17:05:23 +0000
Subject: RE: [PHP] Array problem....
Groups: php.general 
Request: Send a blank email to php-general+get-172493@lists.php.net to get a copy of this message
Jas <mailto:jason.gerfen@scl.utah.edu> on Thursday, December 11, 2003 7:21 AM said: > Well just so you understand "why" I needed something like that here is > the finished result below [snip] > $i = 0; > while(list(...) = mysql_fetch_row(...)) { > $_SESSION[$i] = "..."; > $i++; > } I want to change my suggestion and recommend that you go along with what John Holmes suggested a little after my post. Read his post again and see if it is helpful to you. Keep note of the following aspect: You can remove the $i = 0; and the $i++; by changing $_SESSION[$i] = "..."; to $_SESSION[] = "...";. i.e. The following two code blocks perform the same task: Current: $i = 0; while(list(...) = mysql_fetch_row(...)) { $_SESSION[$i] = "..."; $i++; } New: while(list(...) = mysql_fetch_row(...)) { $_SESSION[] = "..."; } Chris. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/

« previous php.general (#172493) next »