如何同时选择和比较TIME

时间:2014-03-20 10:22:50

标签: php mysql

我想从organisor中选择所有,但只有当$ end_t等于或小于" end_time"表格中的一行

我已将$ end_t存储为数据库中的String 我能回复怎么做:)

这是搭便车的匹配

<?php

    $date_t='3-19-2014';    
    $departure_t='10:21 PM';
    $end_t='10:30 PM';
    $deparure_a='as';
    $destination_a='asa';

    $con = mysqli_connect("localhost","root","", "xxxxxxxxxx");

    $result = mysqli_query($con,"SELECT * FROM organisor WHERE date_trip='$date_t'and 
            departure_time='$departure_t'and departure_address='$deparure_a' and    destination_address='$destination_a'");

      while($row = mysqli_fetch_array($result))
      {
          echo $row['O_id'] . " " . $row['username']. " " . $row['date_trip']. " " .   $row['departure_time'];
          echo "<br>";
      }
?>

0 个答案:

没有答案