Problem with update query

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
szms
Forum Contributor
Posts: 101
Joined: Thu Jun 26, 2003 12:23 pm

Problem with update query

Post by szms »

The following query is not updating the database. but it works perfectly in mysql. Any sugeestion???

$result8 = mysql_query("update NonDummyFunction set Count = Count - 1 where Function_ID = 'Component_ID'");
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post by Stoker »

is there ant record in the table NonDummyFunction that has a value in the column `Function_ID` that reads literally "Component_ID" ?

Perhaps you want to remove the quotes around Component_ID ?

Edit/Add: Just a comment to Sami's post; Reading the manual on the UPDATE syntax may not help much here as I believe szms may have missunderstood the difference between literal strings and a reference to another column, likely to be extra confusing with because of the use of standard quotes ' and backquotes `
Last edited by Stoker on Wed Aug 27, 2003 8:16 pm, edited 1 time in total.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Post Reply