Search code examples
mysqlsqlmysql-error-1064

Syntax error #1064


this is my query:

update `zen_meta_tags_products_description` 
set `metatags_keywords`= 'ice machine, ice maker, ice flaker, Brema,'
WHERE `products_id` = ('1231'; '1232'; '1233'; '1234'; '1235'; '1236'; '1237'; '1238'; '1239'; '1240';) 

Error

MySQL said: Documentation

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 '1232, 1233' at line 1


Solution

  • Remove semicolom from your list

    Insted of = use IN to get write result:

    UPDATE `zen_meta_tags_products_description` 
    set `metatags_keywords`= 'ice machine, ice maker, ice flaker, Brema,'
    WHERE `products_id` IN ('1231', '1232', '1233','1234', '1235', '1236', '1237', '1238', '1239', '1240') ;