i am new in php, i want to search record from one date to another e.g. from 03 Jan 2010 to 16 Mar 2013. i have converted date into time() and stored as int 1428068707 in db as int value. How can i do this with sql query.
Thank you.
You can use between operator in your query.
select * from Your_table
where your_date between 'date1' and 'date2'
You can do it using comparison operators too:
SELECT * FROM Your_table
WHERE your_date >= 'date1' AND your_date <= 'date2'
Try something like this,
SELECT * FROM table_name WHERE date >= '2010-01-03 00:00:00' AND date <= '2013-03-16 00:00:00';
You can also use BETWEEN
SELECT * FROM table_name WHERE date BETWEEN '2010-01-03' AND '2013-03-16';