View Single Post
Old 10-06-2007, 02:46 PM   #7 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,380
Thanks: 5
Salathe is on a distinguished road
Default

Your SELECT queries are not valid SQL since the values used in the LIKE statements are not delimited by quotation marks. Both queries have the same issue which needs to be fixed.

For example:
PHP Code:
// Wrong: SELECT * FROM table WHERE name LIKE search_term
$gSql sprintf("SELECT * FROM %s WHERE name LIKE %s",
// Right: SELECT * FROM table WHERE name LIKE 'search_term'
$gSql sprintf("SELECT * FROM %s WHERE name LIKE '%s' "
Salathe is offline  
Reply With Quote