stellarwp / db

A WPDB wrapper and query builder library.
GNU General Public License v2.0
64 stars 4 forks source link

Use backtick around column name in WHERE statement #18

Open jmslbam opened 8 months ago

jmslbam commented 8 months ago

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 WHEREkey= 2.

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

Kind regads,

Jaime