| 回上一頁 |
| 最新消息 |
| 資料查詢系統 |
查詢條件:"; if($SubjectID!=0) { $sql_cmd = $sql_cmd." AND `SubjectID` LIKE '%$SubjectID%'"; $sql_cmd2 = $sql_cmd2." AND `SubjectID` LIKE '%$SubjectID%'"; $str = "select serial,Day,title,count,CategoryID,SubjectID,PubDay from $NEWS_TBL WHERE SubjectID = $SubjectID"; $str1="select subject.Description from subject where subject.SubjectID='$SubjectID'"; $list1=mysql_query($str1,$link); list($Subject) = mysql_fetch_row($list1); echo "$Subject "; } if($CategoryID!=0) { $sql_cmd = $sql_cmd." AND `CategoryID` LIKE '%$CategoryID%'"; $sql_cmd2 = $sql_cmd2." AND `CategoryID` LIKE '%$CategoryID%'"; $str = "select serial,Day,title,count,CategoryID,SubjectID,PubDay from $NEWS_TBL WHERE CategoryID=$categoryID"; $str1="select category.Description from category where category.CategoryID='$CategoryID'"; $list1=mysql_query($str1,$link); list($Category) = mysql_fetch_row($list1); echo "$Category "; } $str99="select county.Description from county where county.CountyID = '$mail_post1'"; $list99=mysql_query($str99,$link); list($County) = mysql_fetch_row($list99); echo "$County "; if($mail_post1!=0) { $str11="select district.Description,CountyID from district where district.DistrictID='$mail_post1'"; $list1=mysql_query($str11,$link); list($district,$county1ID) = mysql_fetch_row($list1); $str12="select county.Description from county where county.CountyID='$county1ID'"; $list12=mysql_query($str12,$link); list($county1) = mysql_fetch_row($list12); echo "$county1 "; echo "$district "; } $sql_cmd = $sql_cmd." AND (`CountyID` LIKE '%$mail_post1%' OR `DistrictID` LIKE '%$mail_post1%' )"; $sql_cmd2 = $sql_cmd2." AND (`CountyID` LIKE '%$mail_post1%' OR `DistrictID` LIKE '%$mail_post1%' )"; if($year!=0) { $sql_cmd = $sql_cmd." AND extract(year FROM Day) LIKE '%$year%' "; $sql_cmd2 = $sql_cmd2." AND extract(year FROM Day) LIKE '%$year%' "; echo "$year"; echo "年"; } if($month!=0) { $sql_cmd = $sql_cmd." AND extract(month FROM Day) LIKE '%$month%'"; $sql_cmd2 = $sql_cmd2." AND extract(month FROM Day) LIKE '%$month%'"; echo "$month"; echo "月"; } $sql_cmd = $sql_cmd."order by Day desc"; $str=$sql_cmd; $list =mysql_query($str,$link); $list2 =mysql_query($sql_cmd2,$link); list($news_count) = mysql_fetch_row($list2); function subject($subjectID) { require "include/setup.php"; $link=mysql_connect($DB_SERVER,$DB_USER,$DB_PASS); mysql_select_db($DB_NAME,$link); mysql_query("SET NAMES utf8", $link); $str5="select subject.Description from subject where subject.SubjectID LIKE '%$subjectID%'"; $list5=mysql_query($str5,$link); list($subject) = mysql_fetch_row($list5); echo "$subject "; } ?> 資料查詢系統 多重條件查詢

共有 筆資料
80){ $title=substr($title,0,80)."-----"; } $str1="select category.Description from category where category.CategoryID='$categoryID'"; $list1=mysql_query($str1,$link); list($category) = mysql_fetch_row($list1); echo ""; } mysql_close($link); ?>
發佈時間時間標題類別主題人氣值
$PubDay$Day$title$category"; $valueb=explode(' ',$subjectID); $subject=subject($valueb[0]); echo $subject; echo "$count
| 回上一頁 |
| 最新消息 |
| 資料查詢系統 |