Hey
im having a little trouble with this query......
$sql2 = "SELECT sales_table.customer_id, customer_table.*
FROM sales_table, customer_table
WHERE sales_table.customer_id = customer_table.customer_id";
$rs2 = mysql_query( $sql2, $conn );
the idea is i have 2 tables
- customer table
- sales table
when the client enters informstion regarding a sale they eneter the id for the cudtomer who made the sale, in turn realting to the customer from the customer table
fopr exam[ple
i have a sale and the id = 1
in the customer table the customer with an id of 1 is say john.
i want to cerate a query that selects everything from the customer table where the customer id in the sales table is equal to the customer id in the customer table if u get my drift. the only problem is at the mo its selecting all the customer id's from the sale table and displaying the information from the customer table depending on how many entries are in the sales table. so say john has made 3 sales in the sales table the id 1 will be there 3 times, so when i run the query johns details are displayed 3 times etc. i hope this is clear enough for you to understand. any help would be most appriciated cheers
john. 🙂