IM試圖從數據庫數據的文本字段:ヶ輛()預計參數1是字符串
$fothersq=("SELECT others FROM january");
$fothers=mysql_query($fothersq);
<input type="text" placeholder="0" name="febothers" size="11" value="<?php if(@$fothers){echo htmlentities(@$fothers);} ?>">
,但我得到的文本字段此錯誤信息。
Warning: htmlentities() expects parameter 1 to be string, resource given in C:\xampp\htdocs\CashFlow\febprev.php on line 116
也是另一個文本字段我用這個編碼只是爲了測試:
<input type="text" name="febbonus" size="11" placeholder="0" value="<?php if(@$fbonus){echo (@$fbonus);} ?>">
,我得到這個錯誤:
Resource id #7
什麼想法?
請[RTFM用於'mysql_query'](http://php.net/mysql_query)及其實施例。 – deceze
避免使用'@'符號。它已經讓你感到困惑。 –