$query="select * from messages where client_id='$client_id' ORDER BY `id` DESC";
上面的脚本似乎不起作用,我想选择所有等于用户输入的数据,同时按降序发布
$result = $mysqli->query( $query );
while ($row = $result->fetch_object())
{
$mes_agent_id = $row->poster_id;
$id = $row->msg_id;
$mes = $row->message;
$mes = nl2br($mes);
$cdate = $row->date_post;
$msg ="{$mes} <br> . {$cdate}";
$query_agnt ="select * from agent_info where id='$mes_agent_id'";
$result_agnt = $mysqli->query( $query_agnt );
$row_agnt = $result_agnt->fetch_object();
$mes_agent_first = $row_agnt->first;
$mes_agent_last = $row_agnt->last;
//wall ===================================================
?>
<li class="bar<?php echo $id; ?>">
<div id="news-avatar">
<img src="data/agentpic/<?php echo $mes_agent_first.$mes_agent_last; ?>.jpg" style="height:50px;float:left;margin-right:10px;"/>
</div>
<div align="left" class="post_box">
<br><label><strong><?php echo $mes_agent_first.' '.$mes_agent_last; ?></strong></label> <br> <br>
<?php echo $msg; ?>
<br><br><a href="#" class="comment" id="4">comment</a><br>
</div>
<div id='expand_box'>
<div id='expand_url'></div>
</div>
<div id="fullbox" class="fullbox<?php echo $id; ?>">
<div id="commentload<?php echo $id; ?>" >
如何按降序从数据库中发布数据,同时选择应该选择数据的位置?