PHP学院的中学生 2019-05-20 14:14:46 2997次浏览 11条回复 1 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

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

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