note 34603 added to function.mysql-fetch-array

From: Date: Thu, 31 Jul 2003 21:13:12 +0000
Subject: note 34603 added to function.mysql-fetch-array
Groups: php.notes 
Request: Send a blank email to php-notes+get-53112@lists.php.net to get a copy of this message
If you like to keep the numeric values and the associative key values (they both might come handy), you can use the Array returned by mysql_fetch_array() in both ways, just remember a few things: // Associative: remember to skip numeric keys! foreach($Vals as $FieldName => $FieldVal) { if((is_int($FieldName))) continue; // Skip Numeric Indexing // ... } // Numeric: remember not to use cont(..) or divide it by 2 $Length=count($Vals)/2; for(int $i=0;$i<$Length;$i++) { $FieldVal=$Vals[$i]; // ... } ---- Manual Page -- http://www.php.net/manual/en/function.mysql-fetch-array.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34603 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34603&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34603&report=yes

« previous php.notes (#53112) next »