Re: UPDATE mysql
| From: | 1LT John W. Holmes | Date: | Sat, 22 Jun 2002 19:41:51 +0000 |
| Subject: | Re: UPDATE mysql | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-103418@lists.php.net to get a copy of this message | ||
It's correct for PHP, but there's no telling what MySQL is actually
recieving. Are you sure all of those variables have values?? Yeah? Are you
really sure??
Use mysql_error() with your query.
$result = mysql_query("UPDATE ...") or die("Error in update: " .
mysql_error());
---John Holmes...
----- Original Message -----
From: "Phil Schwarzmann" <pschwar@jhmi.edu>
To: <php-general@lists.php.net>
Sent: Saturday, June 22, 2002 2:44 PM
Subject: [PHP] UPDATE mysql
> I can't get UPDATE to work properly when querying MySQL.
>
> $query = "UPDATE $table SET field1='$var1' WHERE id='$id'";
>
> I want to update one field of one row in a table. Is this syntax
> correct?
>