Page 1 of 1

retrieving array of choices...how?

Posted: Tue Dec 02, 2008 3:49 am
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

Re: retrieving array of choices...how?

Posted: Tue Dec 02, 2008 10:12 am
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"

Re: retrieving array of choices...how?

Posted: Wed Dec 03, 2008 4:27 am
by azhan
Ooooo..thanks arborint....I'll try and i;ll let u know whether it works or not... :P