Re: [PHPLIB] 0 is not? From: Damien Moody (damienm <email protected>)
Date: 01/13/00

The code leading up to the warning is:

        if($id)
        {
            if($submit)
            {
                //Update database
                $sql = "update user set
firstname='$firstname',middlename='$middlename',lastname='$lastname' where
id=$id";
                $result = mysql_query($sql);
                echo "Information has been updated.\n";
            }
            else
            {
                //Query database
                $sql = "select from user where id=$id";
                $result = mysql_query($sql);
                $myrow = mysql_fetch_row($result);

with the last line being "line 32".

I was also wondering if it has to do with the table I'm trying to query.
There is an auto_increment int primary key. When I "select * from table" the
first number is always "1" even though I set the default to '0'. How do I
resolve this?

Thanks,
Damien

> From: Philip Strnad <pdstrnad <email protected>>
> Date: Thu, 13 Jan 2000 13:19:57 -0500
> To: Damien Moody <damienm <email protected>>
> Subject: Re: [PHPLIB] 0 is not?
>
> Usually it means that you're trying to do something with a result set
> from a MySQL query, but the result index doesn't exist because of an
> error in the code.
>
> What does the code look like?
>
> -Philip
>
> Damien Moody wrote:
>>
>> I get the following:
>>
>> Warning: 0 is not a MySQL result index in
>> /home/httpd/html/damien/ENTERDATA.PHP3 on line 32
>>
>> I'm trying to set up a simple add/edit/remove your name from a list script.
>> What does this warning mean and how do I fix it?
>>
>> -
>> PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
>> To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
>> the body, not the subject, of your message.

-
PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
the body, not the subject, of your message.