MYSQL话语疑惑

WBOY
Release: 2016-06-13 12:44:16
Original
806 people have browsed it

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template