我差不多一個小時試圖瞭解我在這裏做錯了什麼。這是沒有輸出。問題與搜索數組中的字符串
的連接是好的,該陣列是全數據
<?php header('Content-Type: text/html; charset=utf-8');
// Here's the argument from the client.
$domain = $_GET['string'];
$quest=$_GET['quest'];
$event=$_GET['event'];
$con = mysql_connect('localhost', '******', '********');
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("vocabulary", $con);
$sql="SELECT * FROM `0` WHERE event_name = '".$event."' AND quest_id = '".$quest."'";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$key = array_search($domain, $row);
echo $key;
mysql_close($con);
?>
任何想法佔地 感謝
主要SQL注入漏洞。請查看轉義/ PDO。更多 - http://stackoverflow.com/search?q=sql+injection – Dogbert 2013-05-08 15:31:19
你在$域有什麼? – 2013-05-08 15:32:24
如果域名是你可能會具有轉義字符使結果不匹配 – 2013-05-08 15:33:28