MYSQL Truncated Incorrect DOUBLE Value Error
When attempting to update a database using the following SQL query:
<code class="sql">UPDATE shop_category SET name = 'Secolul XVI - XVIII' AND name_eng = '16th to 18th centuries' WHERE category_id = 4768</code>
The error "1292 - Truncated incorrect DOUBLE value: 'Secolul XVI - XVIII'" is encountered. This error occurs because the syntax of the query is incorrect. The AND keyword is not needed in this query, and it causes the update to fail.
To fix this issue, the AND keyword should be removed from the query. The correct syntax for the update is:
<code class="sql">UPDATE shop_category SET name = 'Secolul XVI - XVIII', name_eng = '16th to 18th centuries' WHERE category_id = 4768</code>
With this corrected syntax, the update should now be successful.
The above is the detailed content of Why am I getting the "Truncated incorrect DOUBLE value" error in my MySQL UPDATE query?. For more information, please follow other related articles on the PHP Chinese website!