2013-01-30 03:23:59 UTC
************
Query
**************
SELECT
@rowCount := COUNT(*)
FROM
mess1veg
WHERE
Name = 'test';
IF (@rowCount >0) THEN
UPDATE mess1veg SET Name='b0' WHERE Name='test';
ELSE
INSERT into mess1veg(User_id,Name,Breakfast,Lunch,Dinner,Total,Time) values('b110010','test','$mess1vegbf','$mess1veglunch','$mess1vegdinner','$mess1veg_total',NOW());
END IF;
**********
Error
**********
SQL query:
IF( @rowCount >0 ) THEN UPDATE mess1veg SET Name = 'b0' WHERE Name = 'test';
MySQL said:
#1064 - 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 'IF (@rowCount >0) THEN
UPDATE mess1veg SET Name='b0' WHERE Name='test'' at line 1