Wuu Posted July 27, 2009 Report Share Posted July 27, 2009 $result = mysql_query(' select t1.message,t1.addtime,t2.members_display_name,t3.avatar_location,t1.id from comments t1 join '.$INFO['sql_tbl_prefix'].'members t2 join '.$INFO['sql_tbl_prefix'].'member_extra t3 on (t1.uid = t2.id && t1.uid = t3.id) where t1.link = '.$id.' && (t1.type = 2 || t1.type = 9) order by t1.id asc'); Šis kods pareizi strādā ,bet vēlos lai izvada vel pie normālā koda arī t1.type = 9 ,kuru ierakstus nevajag joinot ,bet vienkārši izvadīt t1.message,t1.addtime Quote Link to comment Share on other sites More sharing options...
Kavacky Posted July 27, 2009 Report Share Posted July 27, 2009 (edited) Nesmuki noformētu kveriju neizlasīju, bet minējums, ka LEFT OUTER JOIN. Edited July 27, 2009 by Kavacky Quote Link to comment Share on other sites More sharing options...
Wuu Posted July 27, 2009 Author Report Share Posted July 27, 2009 Mēģināju ,bet ka pievienoju left ā mysql uzreiz lamājas uz t1.link = '.$id.' && (t1.type = 2 || t1.type = 9) order by t1.id asc'); Quote Link to comment Share on other sites More sharing options...
Gints Plivna Posted August 14, 2009 Report Share Posted August 14, 2009 Izdrukā ārā SQL teikumu un paskaties kas sanācis. Nav ne mazākā iekāriena minēt, ko tas php kods tev uzģenerē. Gints Plivna http://datubazes.wordpress.com/ 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.