-1
在PHP我有一個功能和功能內我有一個查詢這樣PHP函數示出錯誤()預計參數1是資源數組給定
public function hookHome($params)
{
$defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT'));
global $cookie, $smarty;
$value=array();
$sql_select="SELECT DISTINCT country_name,country_ISO from "._DB_PREFIX_."storeinfo where status='1'";
$result=Db::getInstance()->ExecuteS($sql_select);
while($row=mysql_fetch_assoc($result))
{
$value[] = $row;
}
$smarty->assign('array',$value);
$smarty->assign('default',$defaultLanguage);
}
但它示出了查詢執行後mysql_fetch_array() expects parameter 1 to be resource, array given in storeinfo.php on line 8;
所以可以在這裏有一個人請你告訴我什麼是這裏的問題:像 警告錯誤?任何幫助和建議都將非常可觀。謝謝
與10億28百萬和50個類似的情況一樣,您的查詢失敗,並且您沒有檢查返回值 – 2013-05-09 08:27:37
錯誤消息甚至與提供的代碼不匹配。 – deceze 2013-05-09 08:28:52