Home >Backend Development >PHP Tutorial > 为什么小弟我不会写代码

为什么小弟我不会写代码

WBOY
WBOYOriginal
2016-06-13 12:29:53983browse

为什么我不会写代码?

 <a class="np coolbg" href="student_voice.php?do=add">添加考试</a>

php代码:
if($_GET['do']=='add'){<br />
    include DedeInclude('templets/student/student_voice_add.htm');<br />
	$id = $_POST['username'];<br />
	$email = $_POST['email'];<br />
	$content = $_POST['content'];<br />
	$time = date('Y-m-d H:i:s');<br />
	$category = $_POST['category'];<br />
	$flag = $_POST['flags'];<br />
	$flags=implode(",",$flag);<br />
	$checked = $_POST['checked'];<br />
	//echo $id."<br/>".$email."<br/>".$content."<br/>".$time."<br/>".$category."<br/>".$flags."<br/>".$checked;<br />
	$sql = "INSERT INTO djs_skstudent_voice (username ,content ,time ,category ,checked ,email ,flag)VALUES ('$id','$content', '$time' , '$category', '$checked','$email','$flags')";<br />
	$dsql->ExecuteNoneQuery($sql);

倒是能够添加。但是他会添加一个所有值为空白的。然后才是自己想要添加的。就是说他会先执行一次所有值为空的sql。这是咋回事?

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