gideon prewett Posted December 7, 2009 Posted December 7, 2009 ok i know the title of this thread is a bit missleading but what it want is a good addition to the battletent i want my npcs to be in order of level lowest level at the top and highest at the bottom i know its somthing to do with $q=$db->query("SELECT cb.*,u.*,c.npcid,cy.cityname FROM challengebots cb LEFT JOIN users u ON cb.cb_npcid=u.userid LEFT JOIN challengesbeaten c ON c.npcid=u.userid AND c.userid=$userid LEFT JOIN cities cy ON u.location=cy.cityid"); and i have tryed to do itmyself but i allways get sql errors any help would be aprechiated ?( Quote
Curt Posted December 8, 2009 Posted December 8, 2009 hmm try something like this : ORDER BY money DESC,userid $q=$db->query("SELECT cb.*,u.*,c.npcid,cy.cityname FROM challengebots cb LEFT JOIN users u ON cb.cb_npcid=u.userid LEFT JOIN challengesbeaten c ON c.npcid=u.userid AND c.userid=$userid LEFT JOIN cities cy ON u.location=cy.cityid ORDER BY level DESC"); Quote
gideon prewett Posted December 10, 2009 Author Posted December 10, 2009 thanks that worked great Quote
Zero-Affect Posted December 18, 2009 Posted December 18, 2009 i don't know why but everytime i see someone use a * in MySQL i die a little inside :( Quote
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.