최신글 두개를 보여주려면 어디를 수정해야 하나요? 정보
최신글 두개를 보여주려면 어디를 수정해야 하나요?본문
아래 소스에서 최신글 두개를 보여주려면 어디를 수정해야 되나요?
=======================================================================================
<?
include_once "$_SERVER[DOCUMENT_ROOT]/admin/common.php";
include "$_SERVER[DOCUMENT_ROOT]/admin/inc/pollmain_info.php";
// 설문조사 정보
$sql = "select * from wiz_poll where code = '$code' and pollmain != 'N' order by idx desc";
$result = mysql_query($sql) or error(mysql_error());
$poll_info = mysql_fetch_array($result);
$idx = $poll_info[idx];
$subject = $poll_info[subject];
$content = str_replace("\n", "<br>", strip_tags($poll_info[content]));
$polluse = $poll_info[polluse];
$tdate = date('Y-m-d');
if($poll_info[apermi] == "M" && $wiz_session[id] == "") $polluse = "N";
if($poll_info[sdate] > $tdate || $poll_info[edate] < $tdate) $polluse = "N";
if(strcmp($polluse, "N")) $vote_btn = "<img src='$skin_dir/image/bt_main_vote.gif'onCLick=\"vote();\" style='cursor:pointer'>";
else $vote_btn = "<img src='$skin_dir/image/bt_main_vote.gif'onCLick=\"alert('설문이 종료되었습니다.');\" style='cursor:pointer'>";
$result_btn = "<img src='$skin_dir/image/bt_main_result.gif' onClick=\"document.location='".$purl."?ptype=view&idx=".$idx."'\" style='cursor:pointer'>";
?>
=======================================================================================
<?
include_once "$_SERVER[DOCUMENT_ROOT]/admin/common.php";
include "$_SERVER[DOCUMENT_ROOT]/admin/inc/pollmain_info.php";
// 설문조사 정보
$sql = "select * from wiz_poll where code = '$code' and pollmain != 'N' order by idx desc";
$result = mysql_query($sql) or error(mysql_error());
$poll_info = mysql_fetch_array($result);
$idx = $poll_info[idx];
$subject = $poll_info[subject];
$content = str_replace("\n", "<br>", strip_tags($poll_info[content]));
$polluse = $poll_info[polluse];
$tdate = date('Y-m-d');
if($poll_info[apermi] == "M" && $wiz_session[id] == "") $polluse = "N";
if($poll_info[sdate] > $tdate || $poll_info[edate] < $tdate) $polluse = "N";
if(strcmp($polluse, "N")) $vote_btn = "<img src='$skin_dir/image/bt_main_vote.gif'onCLick=\"vote();\" style='cursor:pointer'>";
else $vote_btn = "<img src='$skin_dir/image/bt_main_vote.gif'onCLick=\"alert('설문이 종료되었습니다.');\" style='cursor:pointer'>";
$result_btn = "<img src='$skin_dir/image/bt_main_result.gif' onClick=\"document.location='".$purl."?ptype=view&idx=".$idx."'\" style='cursor:pointer'>";
?>
댓글 전체

$sql = "select * from wiz_poll where code = '$code' and pollmain != 'N' order by idx desc limit 2";
고맙습니다.~

설문게시를 하나 더 만들어서 질문 두개를 보여주는 방법도 있습니다.