10-06-2007, 02:46 PM
|
#7 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,380
Thanks: 5
|
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' ",
|
|
|
|