Kenny Pollock Posted March 19, 2008 Share Posted March 19, 2008 SELECT v.make, v.model, v.yr, v.amt AS veh_amt, v.color, v.vin,v.op, oh.client_id, oh.id AS load_number, oh.deldtime, oh.pickupdtime, oh.dtime, oh.status, oh.order_uid, oh.driver_id, cm.name AS client_name, oh.instr, oo.order_id, oo.city AS origin_city, oo.company AS ocompany, oo.addr AS oaddr, oo.zip AS ozip, oo.phone AS ophone, oo.cell AS ocell, oo.wphone AS owphone, oo.contact AS ocontact, oo.state AS origin_state, od.city AS destination_city, od.state AS destination_state, od.order_id, od.company AS dcompany, od.addr AS daddr, od.zip AS dzip, od.phone AS dphone, od.cell AS dcell, od.wphone AS dwphone, od.contact AS dcontact, os.id, os.status AS order_status, dm.id, dm.name AS driver_name FROM order_header oh INNER JOIN client_master cm ON cm.id = oh.client_id INNER JOIN order_origin oo ON oo.order_id = oh.id INNER JOIN order_destination od ON od.order_id = oh.id INNER JOIN order_status os ON os.id = oh.status INNER JOIN driver_master dm ON dm.id = oh.driver_id INNER JOIN order_vehicles v ON oh.id = v.order_id WHERE oh.id = '12304'; If there are multiple vehicles in one order, it repeat the whole order page (the query is outputted in a while() statement). I want to show the multiple vehicles in the single order. How would I go about doing this? Quote Link to comment Share on other sites More sharing options...
clown[NOR] Posted March 19, 2008 Share Posted March 19, 2008 if i udnerstood you right you just add ORDER BY or something like that... been awhile since i've been programming now.. just got back to yesterday... so dont get your hopes up Quote Link to comment Share on other sites More sharing options...
Kenny Pollock Posted March 19, 2008 Author Share Posted March 19, 2008 ORDER BY just sorts it. Quote Link to comment Share on other sites More sharing options...
rofl90 Posted March 19, 2008 Share Posted March 19, 2008 LIMIT 0, 1?? Quote Link to comment Share on other sites More sharing options...
DaveLinger Posted March 19, 2008 Share Posted March 19, 2008 LIMIT 1? Quote Link to comment Share on other sites More sharing options...
rofl90 Posted March 19, 2008 Share Posted March 19, 2008 no LIMIT 0,1 Quote Link to comment Share on other sites More sharing options...
DaveLinger Posted March 19, 2008 Share Posted March 19, 2008 no LIMIT 0,1 Either would work, I've used both. However, yours is more specific and is "better" code. Quote Link to comment Share on other sites More sharing options...
rofl90 Posted March 19, 2008 Share Posted March 19, 2008 In this situation he'd be okay, but in others it wouldn't work so may aswell start simple coding patterns for the future Quote Link to comment Share on other sites More sharing options...
Kenny Pollock Posted March 19, 2008 Author Share Posted March 19, 2008 That's limiting my results. So, it will show one order. And if there are multiple vehicles, it will show one. That's not a solution for me. 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.