Re: Array?

From: Date: Wed, 25 Aug 2004 18:56:34 +0000
Subject: Re: Array?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-194718@lists.php.net to get a copy of this message
> 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... print_r is your bestest buddy. > $results = mysql_query($q); > if ($results) { > while ($list=mysql_fetch_assoc($results)) { > $things[]=$list; > } > } > //$things[7] is a MySQL timestamp column named "last_login" $things[7] is actually an associative array containing the seventh result row from your query. If you check out the results of print_r($things), you'd see the array structure immediately. --------------------------------------------------------------------- michal migurski- contact info and pgp key: sf/ca http://mike.teczno.com/contact.html

« previous php.general (#194718) next »