retrieving array of choices...how?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
azhan
Forum Commoner
Posts: 68
Joined: Fri Jun 27, 2008 6:05 am

retrieving array of choices...how?

Post by azhan »

hey guys,

Im having one difficulties, here how I want it to go...

Assuming my table consist of column
DATE|DATA 1| DATA 2| DATA 3|

and im having such data like
DATE |DATA 1 | DATA 2| DATA 3|
01/12/08| 4 | 4 | 3 |
02/12/08| 6 | 6 | 6 |
03/12/08| 8 | 2 | 7 |
04/12/08| 1 | 2 | 3 |

I would like to make a page that could retrieve data from choice date 1 to choice date 2, like this,
--------------------------------------------------------
View Data From [ drop down menu] to [drop down menu]
--------------------------------------------------------
*whereby the [drop down menu] is the choices of date available

is there a code that could do such function ? whereby the user just choose the interval date, then the code will display all the data between the interval..

anyone got any idea?

thanks!

azhan
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: retrieving array of choices...how?

Post by Christopher »

You can do either:

"SELECT * FROM mytable WHERE `date` between $value1 and $value2"

or

"SELECT * FROM mytable WHERE `date` >= $value1 and `date` <= $value2"
(#10850)
azhan
Forum Commoner
Posts: 68
Joined: Fri Jun 27, 2008 6:05 am

Re: retrieving array of choices...how?

Post by azhan »

Ooooo..thanks arborint....I'll try and i;ll let u know whether it works or not... :P
Post Reply