views:

24

answers:

2

When I execute this SQL query:

UPDATE shop_category SET name = 'Secolul XVI - XVIII' AND name_eng = '16th to 18th centuries' WHERE category_id = 4768

I receive the following error:

1292 - Truncated incorrect DOUBLE value: 'Secolul XVI - XVIII'

'shop_category' table structure:

category_id   mediumint(8)
name        varchar(250)
name_eng      varchar(250)

How can I fix this?

Thanks.

+1  A: 

You don't need the AND keyword. Here's the correct syntax of the UPDATE statement:

UPDATE 
    shop_category 
SET 
    name = 'Secolul XVI - XVIII', 
    name_eng = '16th to 18th centuries' 
WHERE 
    category_id = 4768
Darin Dimitrov
A: 

Try replacing the AND with ,

UPDATE shop_category 
SET name = 'Secolul XVI - XVIII', name_eng = '16th to 18th centuries' 
WHERE category_id = 4768

The UPDATE Syntax shows comma should be used as the separator.

codaddict