Home > Article > Backend Development > MYSQL话语疑惑
MYSQL语句疑惑
$sql="select * from news where id = '".$_GET['id']."'";
$query=mysql_query($sql);
$rs=mysql_fetch_array($query);
上面那句查询语句为什么这样写会出错$sql="select * from news where id = $_GET['id']";
求解答,新手关于单引号和双引号的区别和为什么要上面那样写,不明白,谢谢!