Re: Individual Array Entries

From: Date: Fri, 13 Jul 2007 12:13:53 +0000
Subject: Re: Individual Array Entries
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-43785@lists.php.net to get a copy of this message
Here's how you can fill a multi-dimensional array:
$days = array();                                         //Declare $days
to be an array while ($row = mysql_fetch_assoc($result)) //set variable $row to be an associative array containing a row of results from your mysql query
   array_push($days, $row);                      //Inserts a new record
into $days and stores $row in it. This creates a multi-dimensional array Or, if you want it associative: $days = array(); while ($row = mysql_fetch_assoc($result)) $days['whatever here'] = $row; Hope that helps!

« previous php.db (#43785) next »