从数据库中获取记录时,为什么“ 02/15/2019” <=“ 02/11/2019”?

时间:2019-02-15 17:22:51

标签: php mysql

$delivery_date = '02/12/2019';
$stmt = $conn->prepare( "
SELECT o.*
     , o.OID AS order_id
     , o_t_n.order_tracking_id
     , o_t_n.details AS tracking_notification_details 
  FROM bl_orders o 
  JOIN bl_orders_trackings o_t 
    ON o_t.OID = o.OrderNo 
  JOIN bl_order_tracking_notifications o_t_n 
    ON o_t_n.order_tracking_id = o_t.id 
 WHERE o.ODeliveryDate <= ':delivery_date' 
   AND t_n.isReturnReminderNotificationSent = 0
" );
$stmt->execute( [
    'delivery_date' => $delivery_date
] );

在我上面的代码中,ODeliveryDate为“ 02/15/2019”,$ delivery_date为“ 02/11/2019”。为什么即使ODeliveryDate在$ delivery_date之后,该记录仍在获取中?

0 个答案:

没有答案