grumpyoldtechs
01-09-2007, 02:56 PM
SELECT orders.*, customers.* FROM orders LEFT JOIN customers ON orders.customer_id = customers.customer_id WHERE customers.$field LIKE '%$search%' ORDER BY $field ASC LIMIT $offset, $max_rows
sorry if my SQL is a mess SQL isn't my strong point. i need to select all the customers which are valid for the search in which the customer_id is present as a foreign key in the orders table.
basically only show customers which have placed orders.
sorry if my SQL is a mess SQL isn't my strong point. i need to select all the customers which are valid for the search in which the customer_id is present as a foreign key in the orders table.
basically only show customers which have placed orders.