묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
최근게시물을 한페이지당 5개씩 전부뽑고싶은데요...
2003.11.04 12:00
지금은 10개씩 뽑고 있는데요 한페이지당..
이걸 5개씩 뽑으려면 어디를 어떻게 바꿔줘야 하나요?
--------소스---------
$list_num = 10;
$but_num = 5;
if(!$pg_start) $pg_start=0;
if(!$p) $p=1;
$query_1 = "select * from estimate_list order by no desc limit $pg_start , $list_num";
$query_2 = "select * from estimate_list order by no desc";
$result=mysql_query($query_1, $dbconn);
$result_2=mysql_query($query_2, $dbconn);
$rows_2=mysql_num_rows($result_2);
$rows=mysql_num_rows($result);
$fields=mysql_num_fields($result);
$total_num=$rows_2;
if($rows)
{
while($row=mysql_fetch_row($result))
{
$no=$no+1;
$no_1=$rows_2 -(($p-1)*$list_num + $no )+1;
echo("
<td height=25 align=center>$no_1</td>
<td height=25 align=center>$row[1]</td>
<td height=25 align=center>$row[12]</td>
<td height=25 align=center>$row[15]-$row[16]-$row[17]</td>
</tr>
이걸 5개씩 뽑으려면 어디를 어떻게 바꿔줘야 하나요?
--------소스---------
$list_num = 10;
$but_num = 5;
if(!$pg_start) $pg_start=0;
if(!$p) $p=1;
$query_1 = "select * from estimate_list order by no desc limit $pg_start , $list_num";
$query_2 = "select * from estimate_list order by no desc";
$result=mysql_query($query_1, $dbconn);
$result_2=mysql_query($query_2, $dbconn);
$rows_2=mysql_num_rows($result_2);
$rows=mysql_num_rows($result);
$fields=mysql_num_fields($result);
$total_num=$rows_2;
if($rows)
{
while($row=mysql_fetch_row($result))
{
$no=$no+1;
$no_1=$rows_2 -(($p-1)*$list_num + $no )+1;
echo("
<td height=25 align=center>$no_1</td>
<td height=25 align=center>$row[1]</td>
<td height=25 align=center>$row[12]</td>
<td height=25 align=center>$row[15]-$row[16]-$row[17]</td>
</tr>
그걸 5로 해주시면 되겠네요..