<?php
//
// 이전글, 다음글
//
function NextPrev($n,$t=null)
{
if($t)
{
$m = '<';
$o = 'DESC';
}
else
{
$m = '>';
$o = 'ASC';
}
$sql = "SELECT no FROM cwr WHERE no $m $_GET[no] ORDER BY no $o LIMIT 1";
$res = mysql_query($sql) or die(mysql_error()."<font color=red>$sql</font>");
$rs = mysql_fetch_row($res);
mysql_free_result($res);
return $rs[0];
}
?>
//
// 이전글, 다음글
//
function NextPrev($n,$t=null)
{
if($t)
{
$m = '<';
$o = 'DESC';
}
else
{
$m = '>';
$o = 'ASC';
}
$sql = "SELECT no FROM cwr WHERE no $m $_GET[no] ORDER BY no $o LIMIT 1";
$res = mysql_query($sql) or die(mysql_error()."<font color=red>$sql</font>");
$rs = mysql_fetch_row($res);
mysql_free_result($res);
return $rs[0];
}
?>
'Web > PHP' 카테고리의 다른 글
프레임사이트에서 refresh 했을 때 메인으로 돌아가는 문제 (0) | 2013.09.26 |
---|---|
$_FILES (0) | 2013.09.26 |
파일 폴더 용량 (0) | 2013.09.26 |
백분율 Percentage (0) | 2013.09.26 |
한글자르기 (0) | 2013.09.26 |