抱歉标题,但我不能更具体(英语不是我的母语)。这是我的问题:我有 2 个使用 mysql_query() 作为表达式的 while 循环(我知道它已被弃用,但我必须使用它)。虽然第一个循环很好,但第二个是不定式循环,我不知道为什么。我在 phpMyAdmin 中测试了 mysql 查询,没问题。这是我的代码:
while($czat = mysql_fetch_array($data))
{
$user = mysql_fetch_array(mysql_query("SELECT * FROM `tablicacms_users` WHERE `id` = \"{$czat['user_id']}\""));
$feed = $feed.'
<div class="container dropshadow">
<div class="sidebar">
<img class="avatar" src="../'.$user['avatar'].'" />
</div>
<div class="container2">
<div class="profile">
<div class="username">'.$user['user'].'</div>
<div class="datetime">'.$czat['timestamp'].'</div>
</div>
<div class="content">
'.$czat['message'].'
</div>
<div class="answer">odpowiedz<div style="display:none;">'.$czat['id'].'</div></div>
</div>
</div>
<br />';
while($row = mysql_fetch_array(mysql_query("SELECT * FROM `czat2` WHERE `reply` = \"{$czat['id']}\" ORDER BY `id` DESC LIMIT 20")))
{
$reply_user = mysql_fetch_array(mysql_query("SELECT * FROM `tablicacms_users` WHERE `id` = \"{$row['user_id']}\""));
$feed = $feed . '
<div class="odpowiedzi">
<div class="sidebar3"><img src="../'.$reply_user['avatar'].'" /></div>
<div class="container3">
<div class="info">'.$reply_user['user'].'</div>
<div class="timestamp">'.$row['timestamp'].'</div>
</div>
<div class="reply">'.$row['message'].'</div>
</div>
';
}
$feed = $feed . '
<div class="form_odpowiedz" id="'.$czat['id'].'">
<img src="../'.$user['avatar'].'" class="avatar2" />
<form action="" name="odpowiedz"">
<input type="textbox" name="text" class="text_odpowiedz" id="msg_reply_'.$czat['id'].'" />
<input type="hidden" name="answer_id" value="'.$czat['id'].'" class="msg_id" />
<input type="submit" value="Odpowiedz" style="heigth: 30px;" class="odpowiedz" alt="'.$czat['id'].'" />
</form>
<br />
</div>
';}
我希望你能帮助我。