Update query which USED to work

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
Stryks
Forum Regular
Posts: 746
Joined: Wed Jan 14, 2004 5:06 pm

Update query which USED to work

Post by Stryks »

This update query used to run fine but now it just gives an error.

Code: Select all

UPDATE 
   `tbl_vendor_product_price`, 
   `tbl_vendor_product` 
SET 
   `tbl_vendor_product_price`.`cost` = `tbl_vendor_product_price`.`cost` + '0.01' 
WHERE 
      `tbl_vendor_product`.`VI_PK` = `tbl_vendor_product_price`.`VI_ID` 
   AND 
      `tbl_vendor_product_price`.`VS_ID` = '32' 
   AND 
      `tbl_vendor_product`.`TT_ID` = '2'
I have been doing some updating, so it's not impossible that something is changed, but I can see what could be wrong.

Any help here would be great.

Jcart | formated query for readability
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

error is?
User avatar
Stryks
Forum Regular
Posts: 746
Joined: Wed Jan 14, 2004 5:06 pm

Post by Stryks »

Ahh ... A server reload appears to have me saddled with mysql 3.23.58, and I'm pretty sure update joins arent allowed before 4.04.

Will update and see what happens.
User avatar
Stryks
Forum Regular
Posts: 746
Joined: Wed Jan 14, 2004 5:06 pm

Post by Stryks »

Yeah ... the error would be helpfule eh? :roll:

You have an error in your SQL syntax near ' tbl_vendor_product SET `cost` = `cost` + '0.01' WHERE `tbl_vendor_product`.`VI_' at line 1

About to update though, so that may fix it.
Post Reply