RaaapuLis Posted August 14, 2008 Report Share Posted August 14, 2008 (edited) kr4 vleos lai ir nevis Komentari, bet Komentari (skaits) Kā lai "komentāru_skaits" vietā dabūnu skaitli kas skaita komentārus noteiktā tabulā, kuram raksta_id = ". $raksta_id ." Konekcijā viss kārtībā konektējas klāt un viss notiek. Kods: <?php $result=mysql_query("SELECT id, virsraksts, raksts, laiks FROM jaunumi ORDER BY laiks DESC LIMIT 4"); while($row = mysql_fetch_array($result, MYSQL_NUM)) { echo "<h3 class='news_title'>$row[1] </h3><br /> $row[2]<br /><br><strong>Pievienots: </strong>".date("d", $row[3])."/".date("m", $row[3])."/".date("Y", $row[3])." | <a href='komentaari.php?raksta_id=$row[0]'><strong>Komentāri (komentāru_skaits)</strong></a> <br /><br><br /><br><br>"; } ?> Edited August 14, 2008 by RaaapuLis Link to comment Share on other sites More sharing options...
waplet Posted August 14, 2008 Report Share Posted August 14, 2008 ar count palīdzību! Link to comment Share on other sites More sharing options...
RaaapuLis Posted August 14, 2008 Author Report Share Posted August 14, 2008 blin cik tu vari spamot manos postos :@ zb jau, ja nevari neko lādzīgu pateikt tad nesaki un es teicu, nespamo manos postos ! Link to comment Share on other sites More sharing options...
waplet Posted August 14, 2008 Report Share Posted August 14, 2008 Bla es tev kaut ko nepareizi pateicu? Link to comment Share on other sites More sharing options...
cucumber Posted August 14, 2008 Report Share Posted August 14, 2008 SELECT COUNT(id) FROM jaunumi ORDER BY laiks nevajag limit $row = mysql_fetch_array($result, MYSQL_NUM) echo $row[0] ; // te bus skaits Link to comment Share on other sites More sharing options...
RaaapuLis Posted August 14, 2008 Author Report Share Posted August 14, 2008 liels paldies, beidzot viss strādā :D Link to comment Share on other sites More sharing options...
Recommended Posts