리스트에 댓글내용 여러개 출력순서 문의입니다
본문
<?php
$sql = " select wr_name, wr_content from $write_table where wr_parent='{$list[$i][wr_id]}' and wr_is_comment = 1 order by wr_datetime desc limit 5";
$result = sql_query($sql);
while ($row = sql_fetch_array($result))
{
// echo $row[wr_name].' / ';
if($row[wr_content]) $wr_content=cut_str($row[wr_content],100);
else $wr_content=' ';
echo $wr_content;
}
검색하여 찾아낸것으로 사용 하고 있습니다.
리스트 출력시 최신 댓글부터 출력이 되던데
반대로 출력하려면 어떻게 해야 하는지 궁금합니다..ㅠㅠ;
답변 2
<?php
$sql = " select wr_name, wr_content from $write_table where wr_parent='{$list[$i][wr_id]}' and wr_is_comment = 1 order by wr_datetime asc limit 5";
$result = sql_query($sql);
while ($row = sql_fetch_array($result))
{
// echo $row[wr_name].' / ';
if($row[wr_content]) $wr_content=cut_str($row[wr_content],100);
else $wr_content=' ';
echo $wr_content;
}
<?php
$sql = " select wr_name, wr_content from $write_table where wr_parent='{$list[$i][wr_id]}' and wr_is_comment = 1 order by wr_datetime asc limit 5";
$result = sql_query($sql);
while ($row = sql_fetch_array($result))
{
// echo $row[wr_name].' / ';
if($row[wr_content]) $wr_content=cut_str($row[wr_content],100);
else $wr_content=' ';
echo $wr_content;
}