Ask a Question related to Dreamweaver AppDev, Design and Development.
-
sharky92663 #1
PHP Update query not working
Hello,
I'm using a standard update query and getting an error message.
Here is the code:
if ((isset($HTTP_POST_VARS["MM_update"])) && ($HTTP_POST_VARS["MM_update"] ==
"updateQty")) {
$updateSQL = sprintf("UPDATE cart SET qty=%s, WHERE cartId=%s",
GetSQLValueString($HTTP_POST_VARS['qty'], "int"),
GetSQLValueString($HTTP_POST_VARS['cartId'], "int"));
mysql_select_db($database_connMobis, $connMobis);
$Result1 = mysql_query($updateSQL, $connMobis) or die(mysql_error());
Here is the error:
You have an error in your SQL syntax. Check the manual that corresponds to
your MySQL server version for the right syntax to use near 'WHERE cartId=183'
at line 1
I've been pulling my hair over this because it's so straighforward and I've
used this query hundreds to times before. If you notice anything, please let
me know.
Jim
sharky92663 Guest
-
update query not working any ideas?
Hi, I am attempting to do a simple update query using the cfquery tag. The code is: <cfquery datasource="test" name="testers"> update tablename... -
UPDATE using a query?
I thought something would be easy, but I'm lost. Quickly, I'm making a form to sign up employees for a training course. The selection is 1 of 4... -
Update not working :(
Hi, I cant seem to find the problem, I hav an update for which displays items to choose from and then a form at the bottom to enter the model id... -
Working through an update query Coldfusion/Access
I'm working on an update query for a class registration system in ColdFusion 6.1 running against an Access 2000 datasource. In short what I need to... -
Update query help
I'd like to update some of the fields in a table 'master', where some of the data in a row already exists. For example, I'd like to add to a record... -
David Powers #2
Re: PHP Update query not working
sharky92663 wrote:
> $updateSQL = sprintf("UPDATE cart SET qty=%s, WHERE cartId=%s",I would be very surprised if you have used this query hundreds of times> I've been pulling my hair over this because it's so straighforward and I've
> used this query hundreds to times before.
before without getting the same mistake. There should be no comma before
WHERE:
$updateSQL = sprintf("UPDATE cart SET qty=%s WHERE cartId=%s",
--
David Powers
Author, "Foundation PHP 5 for Flash" (friends of ED)
Co-author "PHP Web Development with DW MX 2004" (Apress)
[url]http://computerbookshelf.com[/url]
David Powers Guest



Reply With Quote

