I don't know what wrong with this query. I am getting error. Can please any one tell me about this.
$this->db->where("ac.booking_date", $booking_date);
$this->db->where(''.$booking_date .' NOT BETWEEN ac.booking_date AND ac.end_date', null, false);
A Database Error Occurred
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '10:00 NOT BETWEEN ac.booking_date AND ac.end_date ORDER BY
ac
.id
DESC' at line 7SELECT
ac
.*,p
.first_name
,p
.last_name
FROManb_crm_bookings
ac
LEFT JOINanb_crm_users_personal_info
p
ONp
.user_id
=ac
.created_by
WHEREac
.ac
.record_id
= '36841' ANDac
.booking_date
= '2019-05-29 10:00' AND 2019-05-29 10:00 NOT BETWEEN ac.booking_date AND ac.end_date ORDER BYac
.id
DESCFilename: models/BookingModel.php
Line Number: 245
you're forgetting quotes in the 2nd WHERE. Replace it with the following code
$this->db->where("ac.booking_date", $booking_date);
$this->db->where('"'.$booking_date .'" NOT BETWEEN ac.booking_date AND ac.end_date', null, false);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.