我有一個數據庫,我通過PHPmyadmin創建。我的時間列/計算有問題。我怎樣才能在MySQL查詢當前時間?
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
和(| time_start | time_end |) = Time
< //這樣在phpMyAdmin
而且我的查詢類型不起作用。我猜問題是.time()。查詢:
$query2 = "SELECT location FROM sections where Dr_ID = 1
AND time_start <= ".time()." and time_end > ".time();
請你粘貼創建tabale這裏查詢? –
您是否正在尋找'time_start <= now()和time_end> now()'或許? –