sandis_m Posted January 4, 2010 Report Share Posted January 4, 2010 mysql_query("SELECT name, lastname, birthdate, uid, upicture FROM all_users JOIN all_friends ON all_users.uid = all_friends.friendid WHERE myid='$myid' AND online='1'); Šitais man izvada visus online draugus bet kā lai viņus saskaita? Esmu izmēģinājies visādi, bet uzrāda ka kautkas nav kārtībā iekš SQL syntax mysql_query("SELECT name, lastname, birthdate, uid, upicture [b]AS skaits[/b] FROM all_users JOIN all_friends ON all_users.uid = all_friends.friendid WHERE myid='$myid' AND online='1'); ? vnk taads besis jau čakareeties Vismaz iedodiet lūdzu adresi, kur viss aprakstīts kā pareizi jāveido ... Quote Link to comment Share on other sites More sharing options...
Kavacky Posted January 4, 2010 Report Share Posted January 4, 2010 mysql_num_rows() Quote Link to comment Share on other sites More sharing options...
briedis Posted January 4, 2010 Report Share Posted January 4, 2010 ..bet ja gribi saņemt tikai skaitu, būs jāizmanto agregātfunkcija COUNT() Quote Link to comment Share on other sites More sharing options...
Kemito Posted January 4, 2010 Report Share Posted January 4, 2010 Izmanto mysql_num_rows() funkciju uz tā kverija! :) Quote Link to comment Share on other sites More sharing options...
briedis Posted January 4, 2010 Report Share Posted January 4, 2010 Izmanto mysql_num_rows() funkciju uz tā kverija! :) Ja tādu kvēriju izmanto tikai lai dabūtu vienu skaitli - tā ir lieka resursu tērēšana. Priekš tā ir domāta SQL funkcija - COUNT() Quote Link to comment Share on other sites More sharing options...
2easy Posted January 4, 2010 Report Share Posted January 4, 2010 (edited) anyway Kavacky jau to pateica 3x stundas pirms Kemito... Edited January 4, 2010 by 2easy 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.