Buongiorno, sono di nuovo qui a chiedere aiuto..
Questa volta ho la seguente query:
Codice PHP:
$orders_query_raw = "select o.orders_id, o.delivery_company, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text, adm.admin_id as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC";
che prende da 3 tabelle informazioni riguardanti gli ordini e in output avrò tutti gli ordini effettuati ma a me serve sapere soltanto gli ordini di un venditore. I venditori si possono collegare con vend.admin_id=customers.customers_ref e la tabella customers si può collegare alla tabella TABLE_ORDERS con customers.customers_id=TABLE ORDERS.customers_id. Il vend.admin_id è passato come variabile $login_id.
mi potete per favore indicare come faccio a modificare la query sopra in modo tale che vengano visualizzati soltanto gli ordini fatti dai clienti di un determinato venditore? Sono diperato!
Grazie!