Re: Array?

From: Date: Wed, 25 Aug 2004 18:40:25 +0000
Subject: Re: Array?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-194712@lists.php.net to get a copy of this message
On Thursday 26 August 2004 02:17, Nathan Mealey wrote: > I cannot seem to access elements inside of the array $things in the > code below. All of the errors say "Undefined offset: 7 in > /Library/WebServer/Documents/lis/check.php on line 26" I don't see > why... > > The code is: > > $q = "select * from users where email='".$email."' and > password='".$pass."'"; > $results = mysql_query($q); > if ($results) { > while ($list=mysql_fetch_assoc($results)) { > $things[]=$list; > } > } > //$things[7] is a MySQL timestamp column named "last_login" > $date = strtotime($things[7]); print_r($things); var_dump($things) -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* Dealing with failure is easy: Work hard to improve. Success is also easy to handle: You've solved the wrong problem. Work hard to improve. */

« previous php.general (#194712) next »