I have this SQL :
UPDATE gcd_data
SET post_title = 'Hello World',
post_content = 'How Are You?',
post_date_gmt = '',
post_modified_gmt = '',
post_url = 'www.google.com',
post_type = 'product'
WHERE gcd_id='1024'
IF (ROW_COUNT() = 0)
INSERT INTO gcd_data (gcd_id, post_title, post_content, post_date_gmt,
post_modified_gmt, post_url, post_type)
VALUES ('1024', 'Hello World', 'How Are You?', '', '', 'www.google.com', 'product')
and it gives me error like this :
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'IF (ROW_COUNT() = 0)
INSERT INTO gcd_data (gcd_id, post_title, post_content, pos' at line 9
I read MySQL documentation about IF statement and I didn't find something wrong with that. so, how to correct this?