how many elements are returned by the sql statement?

If you want the 7th item returned in the sql statement would need to
code $things[6]

Just a hunch...

--
Craig Brothers
@utoRevenue
[EMAIL PROTECTED]
(413) 528-8000 x105



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]);
> 
> 
> Thanks in advance,
> Nathan
> --
> Nathan Mealey
> Director of Operations
> Cycle-Smart, Inc.
> P.O. Box 1482
> Northampton, MA
> 01061-1482
> [EMAIL PROTECTED]
> (413) 587-3133
> (413) 210-7984 Mobile
> (512) 681-7043 Fax

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to