在我阿賈克斯聊天腳本我有這樣的警告:7阿賈克斯聊天 - 登錄問題
Warning: mysql_fetch_array() expects parameter 1 to be resource,
boolean given in /home/mychat/public_html/c/listChats.php on line 7
線:
while($row = mysql_fetch_array($sql)){
listChats.php:
<?php
$chats = "";
include_once("scripts/connect_db.php");
$sql = mysql_query("SELECT * FROM (
SELECT * FROM chatBox order by id DESC LIMIT 20
) TMP ORDER BY tmp.id ASC");
while($row = mysql_fetch_array($sql)){
$chat = $row['chatBody'];
$username = $row['username'];
$chats = '<p><span id="un">' . $username . ':</span> ' . $chat . '</p>';
echo "$chats";
}
?>
請[閱讀這一重要職務(http://meta.stackexchange.com/a/5235/135887),這些問題可能會影響您獲得良好答案的能力。 – Charles
@Charles我的問題是關鍵的。 –
-4代表實驗人 –