Thanks, gonna try this later on, ill explain what tables i have etc and see if u think its still correct. 🙂
The tables are not really a trip, but a ridetable. With a row in the table for each seat of the ride. Customers could book like 2 seats on ride a, 3 on ride b, 3 on ride c, and 1 on ride d etc....
ride_a
-time---row_num---seat---booked---customer_id
0900--------1----------a--------1--------------2--------
0900--------1----------b--------1--------------2--------
0900--------1----------c--------0--------------0--------
0900--------1----------d--------0--------------0--------
0900--------2----------a--------1--------------4--------
0900--------2----------b--------1--------------4--------
0900--------2----------c--------1--------------4--------
0900--------2----------d--------1--------------3--------
so there will be 3 other tables like this......
when a seat is booked, its a 1, if not a 0, and the customer_id will be inserted in the customer_id field.
yes u get the picture that i wanna see if people that booked this ride, also booked other rides.
I was thinking it needed DISTINCT, as even though a table may have many instances of a customer_id, i only need to know if a table has that customer_id or not, and not how many times it occurs. (hope u understand me 🙂 )
Also i need to display the results in an order.....most popular first etc.
so like on the ride_a info page, i would like it to say, people who booked this ride, also booked :
ride_b (12)
ride_c (8)
ride_d (3)
where the num in brackets is the amount of matches.
I thank you very much for ya help on this.
Also i had trouble displaying the result, didnt know wether to use mysql_fetch_array, or mysql_num_rows.
Thanks
Elliott