On Wed, 2004-08-25 at 14: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]);
You are fetching an association... use the following instead:
$date = strtotime($things['last_login']);
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php