그누보드 통합검색 방법...
PHP 와 MySql 쿼리를 조합하면
쉽고 빠르게 검색할수 있습니다..
일면 UNION 과 UNION ALL
$tot_sql = "select * from g4_board";
$tot_result = sql_query($tot_sql);
for ($i=0; $tot_row=sql_fetch_array($tot_result); $i++) {
if($i == 0){
$cnt_sql =$cnt_sql."SELECT count(*) cnt FROM g4_write_{$tot_row[bo_table]} ".$search_qry;
}else{
$cnt_sql =$cnt_sql. "UNION ";
$cnt_sql =$cnt_sql."SELECT count(*) cnt FROM g4_write_{$tot_row[bo_table]} ".$search_qry;
}
if($i == 0){
$write_table =$write_table."SELECT * FROM g4_write_{$tot_row[bo_table]} ".$search_qry;
}else{
$write_table =$write_table. "UNION ";
$write_table =$write_table."SELECT * FROM g4_write_{$tot_row[bo_table]} ".$search_qry;
}
}
를 응용해서 사용하시면 될듯합니다^^
그누통합검색이 있지만 간단하게 사용할때 좋아요 ㅎㅎ;;
[이 게시물은 관리자님에 의해 2011-10-31 17:27:00 MySQL에서 이동 됨]
|
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기
댓글 2개