0
選擇什麼是錯我的代碼返回其0的MySQL通過過濾
$query = "SELECT cid, COUNT(cid) FROM topic_reply WHERE cid='$forum_id'";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo "There are ". $row['COUNT(cid)'] ." ". $row['cid'] ." items.";
echo "<br />";
}
我嘗試所有可能的代碼,以顯示其returng 0的結果..但如果我刪除了WHERE過濾其返回所有行發生了什麼?嘿嘿
$論壇=請求mysql_query(「SELECT * FROM論壇其中pid ='$ CAT_ID'「); while($ forumrow = mysql_fetch_array($ forum)) { // code here $ threadcount = mysql_query(「SELECT * FROM topics WHERE parent ='$ forum_id'」); $ thread_count_rows = mysql_num_rows($ threadcount); ($ threadrow = mysql_fetch_array($ threadcount)) { $ parent_id = $ threadrow ['id']; \t \t \t \t } \t \t //這裏 更多的代碼下面繼續 – user2879926
$查詢= 「選擇CID,COUNT(CID)FROM topic_reply WHERE CID = '$ forum_id' GROUP BY CID」; $ result = mysql_query($ query)或die(mysql_error()); \t while($ row = mysql_fetch_array($ result)){\t $ temp1 = $ row ['COUNT(cid)']; \t \t if($ temp1 == 1){echo''; } elseif($ temp1> = 10){echo''; } //依此類推} } – user2879926
@ user2879926,是否有效? –