오늘 쓴글 갯수 뽑아내기 정보
오늘 쓴글 갯수 뽑아내기본문
게시판에 오늘 쓴 글갯수를 뽑아 낼려고 하는데요...
총 글갯수는
$bo_table = 'notice'; // 게시판 id
$row = sql_fetch("select bo_count_write from $g4[board_table] where bo_table='{$bo_table}'");
$total_count = $row[bo_count_write];
이런식으로 뽑아냈는데요..
24시간을 기준으로 새로운 글을 가져올려면 어떻게 해야되는지요
답변브탁드립니다
총 글갯수는
$bo_table = 'notice'; // 게시판 id
$row = sql_fetch("select bo_count_write from $g4[board_table] where bo_table='{$bo_table}'");
$total_count = $row[bo_count_write];
이런식으로 뽑아냈는데요..
24시간을 기준으로 새로운 글을 가져올려면 어떻게 해야되는지요
답변브탁드립니다
댓글 전체

$day = date("Y-m-d H:i:s", strtotime($g4[time_ymdhis])-60*60*24);
$bo_table = 'notice'; // 게시판 id
$row = sql_fetch("select count(wr_id) as cnt from $g4[write_prefix]$bo_table where wr_datetime >= $day");
$total_count = $row[cnt];
와 같이 해보십시오.
$bo_table = 'notice'; // 게시판 id
$row = sql_fetch("select count(wr_id) as cnt from $g4[write_prefix]$bo_table where wr_datetime >= $day");
$total_count = $row[cnt];
와 같이 해보십시오.
곱슬님 감사합니다
그런데 이런에러가 --
select count(wr_id) as cnt from g4_write_notice where wr_datetime >= 2007-11-21 13:15:21
1064 : You have an error in your SQL syntax near '13:15:21' at line 1
error file : /admin/adm/index.php
그런데 이런에러가 --
select count(wr_id) as cnt from g4_write_notice where wr_datetime >= 2007-11-21 13:15:21
1064 : You have an error in your SQL syntax near '13:15:21' at line 1
error file : /admin/adm/index.php

$day --->'$day'