db icon indicating copy to clipboard operation
db copied to clipboard

Use backtick around column name in WHERE statement

Open jmslbam opened this issue 1 year ago • 0 comments

I have column named key which is a reserved word in MySQL.

If you don't use a backtick ``` in you SQL query then will error.

My SQL that was build by this library was SELECT * FROM secure_holiday_feature WHERE key = '2' which didn't give any result.

This one did SELECT * FROM secure_holiday_feature WHERE key = 2.

It also messes up the ->update() query.

Kind regads,

Jaime

jmslbam avatar Feb 20 '24 00:02 jmslbam