도와주세요 ㅠㅠ 새글 올라오면 메뉴에도 뉴이미지 표시되도록 할려고 합니다. 정보
도와주세요 ㅠㅠ 새글 올라오면 메뉴에도 뉴이미지 표시되도록 할려고 합니다.본문
새글 올라오면 메뉴에도 뉴이미지 표시되도록 할려고 합니다.
<?
// 여기부터
//24시간 이내의 글 수 알아내기
$new_icon = "<img src='$g4[path]/img/icon_new.gif' align='absmiddle'>"; //이미지 파일 경로
function new_count($table_id){
// 오늘을 불러옵니다.
$intime = date("Y-m-d H:i:s", time() - (int)(60 * 60 * 24));
// 여기는 오늘과 글쓴 날짜를 비교합니다.
$tmp_write_table .= "g4_write_$table_id";
$sql2 = " select wr_datetime from $tmp_write_table where wr_datetime >= '$intime'";
// 새로운 글이 몇개 있는지 확인합니다.
$result2 = sql_query($sql2);
$total_count = mysql_num_rows($result2);
if ($total_count > 0) {
// $str_cnt .= " [".$total_count."]";
$str_cnt .= "".$total_count."";
return $str_cnt;
}
else {
$str_cnt .= "";
return $str_cnt;
}
}
// 여기까지
?>
// 여기부터
//24시간 이내의 글 수 알아내기
$new_icon = "<img src='$g4[path]/img/icon_new.gif' align='absmiddle'>"; //이미지 파일 경로
function new_count($table_id){
// 오늘을 불러옵니다.
$intime = date("Y-m-d H:i:s", time() - (int)(60 * 60 * 24));
// 여기는 오늘과 글쓴 날짜를 비교합니다.
$tmp_write_table .= "g4_write_$table_id";
$sql2 = " select wr_datetime from $tmp_write_table where wr_datetime >= '$intime'";
// 새로운 글이 몇개 있는지 확인합니다.
$result2 = sql_query($sql2);
$total_count = mysql_num_rows($result2);
if ($total_count > 0) {
// $str_cnt .= " [".$total_count."]";
$str_cnt .= "".$total_count."";
return $str_cnt;
}
else {
$str_cnt .= "";
return $str_cnt;
}
}
// 여기까지
?>
위소스를 넣고
<? if (new_count(event) > 0) { echo "$new_icon"; }?>
위처럼 적용했습니다. 그런데 아래와 같은 문구가 나오네요..
어떻게 해야합니까 ?ㅠㅠ 도와주세요!!
select wr_datetime from g4_write_event where wr_datetime >= '2007-08-26 23:10:48'
1146 : Table 'padfaps.g4_write_event' doesn't exist
error file : /bbs/board.php
댓글 전체
무슨말이신지 잘 모르겠어요 ㅠㅠ
에러자체는 해당 테이블이 없다고합니다 테이블한번 확인해보세요
좋은하루되세요 g4_write_event 존재 하는 테이블인지 확인해보세요~
좋은하루되세요 g4_write_event 존재 하는 테이블인지 확인해보세요~
맞다맞다 ㅎㅎ 테이블이름 다르게 지정했었던걸 까먹었네요 고마워요!!
저녁은 스셨쎼요?
저녁은 스셨쎼요?