Re: Funny errors with IF
| From: | Olivier Hubert | Date: | Fri, 13 Apr 2001 00:00:21 +0000 |
| Subject: | Re: Funny errors with IF | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-6690@lists.php.net to get a copy of this message | ||
Hi,
>if ($submit) {
> // here if no ID then adding else we're editing
> if ($id) {...
>
>where id is the first field of mydb. Using other pages I can see that the
>id is there in the mydb file. I also get the same error for "if ($submit..."
Ok, I may be wrong here as I'm no PHP expert, but from my limited
experience with MySQL I know you can't just reference fields in the
database like this. You have to first fetch them using mysql_fetch_array or
mysql_fetch_row (or something equivalent). And then you can use/call them
with the appropriate array index (e.g. Array[0] or Array["Key"] depending
on the type of array you choose)
Hope this helps,
Olivier