這是爲了從URL中獲取數據並將其提交給數據庫,並且出現錯誤: 查詢是空的;MySQL查詢爲空
我把一些更多的東西在那裏測試,是的,它給出了我設置的變量的值。在此先感謝
<?php
require 'variables.php';
if(empty($_REQUEST['Key']) || empty($_REQUEST['Computer']) || empty($_REQUEST['Panel'])){
die("Nothing was given for me to give back :(");
}else{
$key = $_REQUEST['Key'];
$computer = $_REQUEST['Computer'];
$panel = $_REQUEST['Panel'];
$insertquery = mysql_query("INSERT INTO keys (Key, PC, Panel) VALUES ('".$key."', '".$computer."', '".$panel."')");
$sql = mysql_query($insertquery);
if($sql){
echo "good ". mysql_error();
}else{
echo "bad ". mysql_error();
echo "<br />".$key." ".$computer." ".$panel."";
}
}
?>
在這裏看到的 - http://stackoverflow.com/questions/636032/why-do-i-get-the-mysql-error-query-是空的?rq = 1 –