jonseg / crud-admin-generator

An open source tool to generate a complete backend from a MySql database.
http://crud-admin-generator.com/
MIT License
1.43k stars 441 forks source link

Quote column names when constructing SELECT query #101

Closed ifigueroap closed 8 years ago

ifigueroap commented 8 years ago

I had a table with a field named 'order', which triggered a SQL syntax error. You should change:

$whereClause =  $whereClause . " " . $col . " LIKE '%". $searchValue ."%'";

to

$whereClause =  $whereClause . " '" . $col . "' LIKE '%". $searchValue ."%'";

Notice the extra quotation around $col

ifigueroap commented 8 years ago

This is a duplicate of #91