Re: PHP Update query
| From: | Jason Gerfen | Date: | Wed, 04 Nov 2009 17:20:54 +0000 |
| Subject: | Re: PHP Update query | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-46628@lists.php.net to get a copy of this message | ||
$query = "UPDATE
clients SET company = '$company', contact =
'$contact', phone = '$phone', city = '$city' WHERE
clients.reference =$client LIMIT 1";
$client_result=mysql_query($query);
// now check for errors
mysql_error() & mysql_errno()
Sudheer Satyanarayana wrote:
On Tuesday 03 November 2009 11:29 AM, Ron Piggott wrote:-- Jason Gerfen Systems Administration/Web application development jason.gerfen@scl.utah.edu Marriott Library Lab Systems PC 295 South 1500 East Salt Lake City, Utah 84112-0806 Ext 5-9810How do I test if an UPDATE query worked $query = "UPDATEFrom the manual page: "For other type of SQL statements, INSERT, UPDATE, DELETE, DROP, etc, *mysql_query()* returns *TRUE* on success or *FALSE* on error. " If $client_result == true you know the query was successful.clientsSETcompany= '$company',contact= '$contact',phone= '$phone',city= '$city' WHEREclients.reference=$client LIMIT 1"; $client_result=mysql_query($query); ??? Ron