PHP学院的中学生 2019-05-20 14:14:46 359次浏览 7条回复 0 0 1
$lft = 111;$rgt = 222;
$sql  = 'SELECT * FROM team WHERE lft BETWEEN {$lft} AND {$rgt}';
echo $sql; 

原样输出:SELECT * FROM team WHERE lft BETWEEN {$lft} AND {$rgt}

$lft = 111;$rgt = 222;
$sql  = "SELECT * FROM team WHERE lft BETWEEN {$lft} AND {$rgt}";
echo $sql; 

自动替换了:SELECT * FROM team WHERE lft BETWEEN 111 AND 222

省老心了,无意发现的,大神勿喷啊。

亿速云
您需要登录后才可以回复。登录 | 立即注册