Home  >  Article  >  Backend Development  >  关于PHP100视频教程中的edit.php,该如何处理

关于PHP100视频教程中的edit.php,该如何处理

WBOY
WBOYOriginal
2016-06-13 12:05:09794browse

关于PHP100视频教程中的edit.php
视频教程的代码如下,作用为点击编辑选取数据库中 id="当前选取评论的id然后编辑其内容",数据库中ID设定的是auto_increment,视频教程上可以轻松获取出当前评论的数组,我却获取不到。在$sql="select * from `feedback` where `id`='".$_GET['id']."'";前加上echo 显示为select * from `feedback` where `id`=‘’ 为什么获取不到当前项的ID还是哪边代码错了,跪求各位大大帮忙!
------解决方案--------------------
你的url 上有?id=  这个查询字符串吗?
------解决方案--------------------
if (!empty($_GET['id'])){
//
}
当$_GET['id']不等于空时,才会继续执行,
除非你的$_GET['id']是空值,var_dump($_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