1 Vote Vote

how can i take the current time in mysql query ?

Posted by topdog 335 days ago Questions| time query mysql All

I have a database which i created via PHPmyadmin. And I have problem with the time columns/calculation.

table name = course

..course_name | section_ID | Dr_ID | time_start | time_end | location 
...................................| 10:00:00 | 10:20:00 < //i but the
                                                        value like this 

And the type of (| time_start | time_end |) = Time < //like this in PHPmyadmin

And my query doesn't work. I guess the problem is .time(). in the query:

$query2 = "SELECT location FROM sections where Dr_ID = 1
           AND time_start <= ".time()." and time_end > ".time();   

Originally asked by: PHP boy on Stack Overflow

Discuss Bury


Who Voted for this Question