sql - Compare MySQL "Time" Field with String in PHP -


I have a specific line in my database, with the following information:

  : User_id start_time end_time 405 12:00:00 14:00:00  

I have the following selection statement:

  data from SELECT * to INNER user Join Users.user_id = where the data is not present (Select * Date between '10: 00: 00 'between start_time and end_time) users by users ".");  

Now, I think this question will return the above line (user 405), however, it does not bring anyone back. (Because 10:00 am is not between 12:00:00 and 14:00:00).

Interesting, if I change the value from 10:00 to 07:00:00, then it works fine.

Why is this not working but any thoughts? In the database, set up the fields as my TIME, and they have been formatted as: 00:00:00

Thanks a lot!

Update:

I changed my query to look like this:

  select usrID, first , From previous users where no User_id (select from `u`user_id``````,` user` u WHERE d.user_id = u.user_id and CAST ('10: 00: 00 'as between time) start_time and End_time) order by u.user_id  

and this was the trick. Thanks for all the help.

Try:

  SELECT * FROM data by user user U.UG_ID = D.User_ID where u does not exist (Select data number from where t.id = d.id and CONVERT ('10: 00: 00 ', TIME) between T.start_time and T. end_time) GROUP BY u.usrID  

When you evaluate properly, you will see that you are not related to subquariums - just because they are the same table, t means that Two questions are related.


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -