Home  >  Article  >  Backend Development  >  MYSQL话语疑惑

MYSQL话语疑惑

WBOY
WBOYOriginal
2016-06-13 12:44:16807browse

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']";
求解答,新手关于单引号和双引号的区别和为什么要上面那样写,不明白,谢谢!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn