Jump to content

Multiple results, want one


Kenny Pollock

Recommended Posts

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.