如何添加mysql_real_escape_string
到此搜索查询?
mysql_query("SELECT * FROM logs WHERE text LIKE '%$text%'");
$text
来自 POST 功能。我尝试了很多组合都没有成功。
试过:
mysql_query("SELECT * FROM logs WHERE text LIKE '" . mysql_real_escape_string(%$text%) . "'");
mysql_query("SELECT * FROM logs WHERE text LIKE 'mysql_real_escape_string(%$text%)'");