當我有一個非常簡單的請求,並不能找出爲什麼這是錯的:mysql的PHP錯誤調用錶行
if ($_GET['linklabel'] !== '')
{
$query = "SELECT templateid FROM pages WHERE linklabel = {$_GET['linklabel']}";
$result=mysql_query($query);
$templateid = $result['templateid'];
echo $templateid;
if ($result !== 0)
{
include($templateid.'.php');
}
else
{
include('404error');
}
}
該表中的templateid有測試的VARCHAR值。瀏覽器說它找不到文件test.php
我輸入了什麼錯?
迴應變量$templateid
也不會輸出任何東西,所以我的想法是$templateid = $result['templateid'];
有什麼問題嗎?