[버그] 카테고리별 카운트 하기 - 패치 포함
admin_category_list.php: 14
$sql_ca = " select * from $nc[tbl_category] ";
$result_ca = mysql_query($sql_ca);
for ($i=0; $ca=mysql_fetch_array($result_ca); $i++) {
$tot = sql_total($nc[tbl_club], "cc_id", $ca[cc_id], $que="");
sql_query(" update $nc[tbl_category] set cc_total = '$tot' where cc_id = '$ca[cc_id]' ");
}
..
.
=========
sql_total에서 $row[0]를 리턴하므로
cc_total = '$tot[0]' 에서 cc_total = '$tot' 로 수정
=========
// 데이터 수
function sql_total($table, $column, $data, $que="")
{
global $nc;
$sql = " select count(*)
from $table
where $column = '$data'
$que ";
$row = mysql_fetch_array(mysql_query($sql));
return $row[0];
}
$sql_ca = " select * from $nc[tbl_category] ";
$result_ca = mysql_query($sql_ca);
for ($i=0; $ca=mysql_fetch_array($result_ca); $i++) {
$tot = sql_total($nc[tbl_club], "cc_id", $ca[cc_id], $que="");
sql_query(" update $nc[tbl_category] set cc_total = '$tot' where cc_id = '$ca[cc_id]' ");
}
..
.
=========
sql_total에서 $row[0]를 리턴하므로
cc_total = '$tot[0]' 에서 cc_total = '$tot' 로 수정
=========
// 데이터 수
function sql_total($table, $column, $data, $que="")
{
global $nc;
$sql = " select count(*)
from $table
where $column = '$data'
$que ";
$row = mysql_fetch_array(mysql_query($sql));
return $row[0];
}
|
댓글을 작성하시려면 로그인이 필요합니다.
로그인
댓글 4개
오늘의 게시물 수를 카운트 하는 것으로도 해봐야 겠네요 ^^
갠적으로 100점.