Reputation: 738
I have a script that is generating queries like this one by grabbing categories and keywords from the database. However something is wrong with the syntax it seems. here is the code first:
UPDATE `mrhowtos_main`.`eng-jap` SET `category` = 'travel' WHERE `eng` REGEXP 'abroad|country|sight seeing|foreign|plane|train|bus' and where `category` REGEXP 'misc|none';
and here is the error returned by mySQL:
category
REGEXP 'misc|none'' at line 1I have looked at it for a long time and still dont seem to see what is wrong with it. im certain the error is not in the table or column names in the DB.
Upvotes: 0
Views: 136
Reputation: 14691
The second where
shouldn't be there. Try:
UPDATE `mrhowtos_main`.`eng-jap` SET `category` = 'travel' WHERE `eng` REGEXP 'abroad|country|sight seeing|foreign|plane|train|bus' and `category` REGEXP 'misc|none';
Upvotes: 2