0

I have a MySql database that uses a time field to track when the entry was inserted.

Now I want to query the table for entries by a time range.
I would prefer to use MySql to extract the records instead of extracting all records then iterating and comparing time in php.

success on these two kinds of queries:

// this doesn't appear to be working
SELECT * FROM table_name 
WHERE DATE(TIME_ROW_START) BETWEEN '".$timestart."' AND DATE(TIME_ROW_END) BETWEEN '".$timeend."';

// this doesn't appear to be working either
SELECT * FROM table_name 
WHERE DATE(TIME_ROW_START) >= '".$timestart."'
AND DATE(TIME_ROW_END) <= '".$timeend."';

Is there a way to do this?

Edited by israillaky: n/a

2
Contributors
6
Replies
7
Views
5 Years
Discussion Span
Last Post by israillaky
0

This is related to http://www.daniweb.com/web-development/php/threads/410631/1752245

You failed to reply to that thread and started this one. Any reason?

Im so sorry sir for not replying.

actually sir im just trying this one and if its work
the reason that ididt reply is because i created this one for temporary purpose only if i use sql query to trap range time using time format in mysql.

if its ok with you sir

and im very sorry for not replying you. hope you understand

0

Maybe you should stick to the same thread. Progression of an idea is a worthy *addition* to an existing thread that you started. Creating new threads and ignoring threads in progress just risks alienating contributors that offered to help you.

0

Maybe you should stick to the same thread. Progression of an idea is a worthy *addition* to an existing thread that you started. Creating new threads and ignoring threads in progress just risks alienating contributors that offered to help you.

ok sir and im so sorry

im going to back to the first thread i post

0

OK, perhaps mark this as solved - just to prevent others from posting here, and carry on with the old one. :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.