MySQL Syntax Code Error - driving me crazy

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
texmansru47
Forum Commoner
Posts: 42
Joined: Mon May 12, 2008 11:27 am

MySQL Syntax Code Error - driving me crazy

Post by texmansru47 »

I have a php form where I need to delete consumed product from Quantity on Hand in a MySQL but add the Consumed data to the table as well as the consumed date. The code I have is as follows:

$query = "UPDATE SNAInv SET `QtyOnHand` = `QtyOnHand` - '$_POST[Consumed]', `Consumed`, `ConSumDate` WHERE ProdNum = '$_POST[ProdNum]', '$_POST[Consumed]', Now()";


The old stroy is true if you stare at code too much you cannot see the problem no matter how simple.. So if someone could be my extra set of eyes and see what I cannot I would be thankful.

Texman
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: MySQL Syntax Code Error - driving me crazy

Post by John Cartwright »

Hint, WHERE clause are not comma delimited
Post Reply