我知道這已被問及一百萬次,但我已經閱讀過,我似乎無法看到問題所在。爲什麼我會得到警告:Mysql_fetch_array()期望參數1是資源,布爾給定?
我使用的是從W3教程中的選擇代碼:
$con = mysql_connect("$server","#user","$admin");
if (!$con) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("$db", $con);
$result = mysql_query("SELECT * FROM options");
while($row = mysql_fetch_array($result)) {
echo $row['copy_right'];
}
mysql_close($con);
,然後顯示在:
<?php $FP->copy_right(); ?> if it matters,
完整的錯誤我得到的是:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /Applications/XAMPP/xamppfiles/htdocs/frontcms/app/core/core.php on line 112
這已經被問[4937](HTTP://計算器。 COM /搜索q =警告%3A + Mysql_fetch_array%28%29 +預計+參數+ 1 +到+ be +資源%2C +布爾+給定)到目前爲止! – Zuul
@zuul:你仍然在編輯帖子。 – sephoy08
@ sephoy08需要改進!我的時間,我的損失:) – Zuul