searching through a table w/ info from an array

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
ee99ee
Forum Newbie
Posts: 9
Joined: Mon Mar 03, 2003 6:45 pm
Location: TN, USA
Contact:

searching through a table w/ info from an array

Post 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
Post Reply