sandis_m Posted December 27, 2009 Report Share Posted December 27, 2009 <?php // bla bla bla $query = "SELECT COUNT(*) FROM mail WHERE status='unread'"; $result = mysql_query($query) or die(mysql_error()); // while($row = mysql_fetch_array($result)){ echo "". $row['COUNT(message)'] ." nelasiitas vestules."; } ?> ...bet viņš neraada skaitu ;( Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted December 27, 2009 Report Share Posted December 27, 2009 <?php $query = "SELECT COUNT(*) AS skaits FROM mail WHERE status='unread'"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_assoc($result); echo $row["skaits"] . " neizlasītas vēstules"; ?> Cikls nav vajadzīgs, jo tāpat tiks atgriezta viena rindiņa. Quote Link to comment Share on other sites More sharing options...
waplet Posted December 27, 2009 Report Share Posted December 27, 2009 varbūt tāpēc, ka tev irsavādākas kolonnas un tabulas? Quote Link to comment Share on other sites More sharing options...
briedis Posted December 27, 2009 Report Share Posted December 27, 2009 imo, prātīgāk būtu glabāt statusu kā bool tipa vērtību - 1 - izlasīta, 0, nelasīta... :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.