嘗試將某些信息查詢到數據庫中,但似乎無法找到該錯誤。我一直在PHP的MySQL函數上遇到一些麻煩,但我會說大約90%的修復都是簡單的語法錯誤。mysql_fetch_assoc():6不是有效的MySQL結果資源
$TableName = "opportunities";
$Opportunities = array();
$SQLString = "SELECT opportunity_ID, company, city, " .
"start_date, end_date, position, description" . " FROM $TableName;";
$QueryResult = mysql_query($SQLString);
if (mysql_num_rows($QueryResult) > 0)
{
while (($Row = mysql_fetch_assoc($QueryResult)) !== FALSE)
{
$Opportunities[] = $Row;
mysql_free_result($QueryResult);
}
}
http://stackoverflow.com/questions/1858304/mysql-fetch-assoc-supplied-argument-is-not-a-valid-mysql-result-resource-in-p?rq=1 – Marty
http:///stackoverflow.com/questions/3268691/mysql-num-fields-supplied-argument-is-not-a-valid-mysql-result-resource?rq=1 – Marty
http://stackoverflow.com/questions/3568478/mysql -mysql-fetch-assoc-supplied-argument-is-not-a-valid-mysql-result-resour?rq = 1 – Marty