Home  >  Article  >  Backend Development  >  sql取值范围的有关问题

sql取值范围的有关问题

WBOY
WBOYOriginal
2016-06-13 13:33:271003browse

sql取值范围的问题
select * from message where title = $_GET['link']这句话有问题,但echo $_GET['link']是可以的,说明$_GET['link']有值,但拿$_GET['link']去比较久不行了,要怎么改啊?

------解决方案--------------------
$sql = "select * from message where title ='{$_GET['link']}'"
------解决方案--------------------
插入时和接收值时可以用 ='$_GET[link]'

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