Mysql search query

Table structure regpro

idsoobsh

date

tipproish


Regpro table data dump

1| 2011-11-01 18:38:26| ebistvo|

2| 2011-11-02 10:41:47| razboi|

3| 2011-11-04 10:41:47| toto|

SELECT * FROM regpro WHERE date = '2011-11-01 18:38:26'

This is a simple date search, but how do you search from a specific date to a specific date?


Answer 1, authority 100%

Something like this:

SELECT * FROM regpro WHERE date BETWEEN '2011-11-01' AND '2011-12-01'

Answer 2, authority 100%

Store the date in timestamp format (time in seconds), form the date with date()and the request will be like

SELECT * FROM regpro WHERE date >= '123454784876' AND date <='123454884976'

to parse the date use getdate()