Everything was working fine before I upgraded my mysql version on server.
But now it's giving error and shows query failure. I have changed nothing in code.
SELECT id,frequency,speed FROM signal where active='Y'
It's showing error in from clause.Why this happening ?
Seems you upgraded in Mysql5.5 and SIGNAL
is new reserved keyword in Mysql5.5. Escape
your table name signal with backticks(`) in query.
Try below :
SELECT id,frequency,speed FROM `signal` where active='Y'
SIGNAL
is a MySQL reserved word, apparently. Enclose it in backquotes.
SELECT id,frequency,speed FROM `signal` where active='Y'
Whenever I get an error I don't expect in the FROM
clause or elsewhere when the query appears to be syntactically correct, I consult the reserved words list for something I wasn't aware was reserved (and I admit I wasn't aware SIGNAL
was reserved until I checked the list).
A bit of research hasn't pinned down when SIGNAL
was added yet, but I suspect it was in MySQL 5.5.