anonīms Posted March 1, 2008 Report Share Posted March 1, 2008 (edited) Nepieciešams, lai forumā kods saskaitītu cik pavisam ir atbildes zem šī foruma, bet viņš tikai skaita no 1 topika $pcnt = mysql_query("SELECT count(*) as cnt FROM forums_topiki where kategorijas_id = $forums[0] "); $pcnt = mysql_fetch_array($pcnt); $pcnt = $pcnt[cnt]; //////////////////////////////////////////////////////// // Atbildes $atbildes_foruma_sakumaa = mysql_query("SELECT id FROM forums_topiki where kategorijas_id = $forums[0]"); $atbildes_foruma_sakumaa = mysql_fetch_array($atbildes_foruma_sakumaa); $pcnt3 = mysql_query("SELECT count(*) as cnt3 FROM forums_atbildes WHERE topika_id = $atbildes_foruma_sakumaa[0] "); $pcnt3 = mysql_fetch_array($pcnt3); $pcnt3 = $pcnt3[cnt3]; echo "<td><div style='text-align: center;'>".$pcnt3."</div></td></tr>"; Edited March 1, 2008 by anonīms Link to comment Share on other sites More sharing options...
Aleksejs Posted March 1, 2008 Report Share Posted March 1, 2008 SELECT COUNT(forums_atbildes.id) AS skaits FROM forums_atbildes, forums_topiki WHERE forums_atbildes.topika_id = forums_topiki.id AND forums_topiki.kategorijas_id = ' . $forums[0] P.S. Vispār jau vajag arī tabulu struktūru norādīt, ja prasi ko šādu, jo tās kristāla bumbas ir liels deficīts... ;) Link to comment Share on other sites More sharing options...
anonīms Posted March 1, 2008 Author Report Share Posted March 1, 2008 Paldies :) Link to comment Share on other sites More sharing options...
Recommended Posts