如果我执行我的PHP代码:
$serName = $_GET['username'];
// Code for sanitation here
// [...]
$sql = "SELECT NAME FROM PLAYERS WHERE NAME LIKE '%$serName%'";
我得到除法错误,如何在双方使用通配符的查询中使用变量?
答案 0 :(得分:3)
答案 1 :(得分:0)
$sql = "SELECT NAME FROM PLAYERS WHERE NAME LIKE '%" .$serName. "%'";