Page 1 of 1

searching through a table w/ info from an array

Posted: Sat Mar 15, 2003 6:19 pm
by ee99ee
I am building a database driven rental managment system (PHP of course). When a person places an order, it puts the info in a table called orders. In this table, it has the customer's ID, the product ID of what they are renting, the day they will pick it up, and the day it will be back in stock ready to be rented out again.

Now, let's say there are 5 products, right now it will pick the ID of the first product it finds in the products table and use that as the product ID. What I need to be able to do is go through and find every product that matches what they are renting (every ID), stick that in an array I guess, and then go searching through the orders table and see if any of the product IDs in the array are being rented out for the date range the customer is going to have the product.

I'm not really sure how I would do this. Any ideas or suggestions?

-ee99ee