How do I pick a selection of rows with the minimum date difference

jamespriligy1o

New Member
The question was difficult to phrase. Hopefully this will make sense.I have a table of items in my INVENTORY.Let's call the items Apple, Orange, Pear, Potato. I want to pick a basket of FRUIT (1 x Apple,1 x Orange, 1 x Pear).Each item in the INVENTORY has a different date for availability. So that...[*]Apple JANUARY [*]Apple FEBRUARY[*]Apple MARCH[*]Orange APRIL[*]Apple APRIL[*]Pear MAYI don't want to pick the items in the order they appear in the inventory. Instead I want to pick them according to the minimum date range in which all items can be picked. ie Orange & Apple in APRIL and the pear in MAY.I'm not sure if this is a problem for MYSQL or for some PHP arrays. I'm stumped. Thanks in advance.
 
Back
Top