从预订表中查询预订日期从汽车餐桌上取车,如果预订表中有可用日期,则不要显示该特定车辆

时间:2016-12-21 10:36:17

标签: php mysqli

从预订表中检查预订日期,从汽车餐桌上取车,如果在预订表中有可用日期,则不要显示该特定车辆

第一个表格名称= car:

jni.jar

AND第二个表格名称=预订:

car_id,company,model

代码

car_id,booking_date

1 个答案:

答案 0 :(得分:-1)

$ sq = mysqli_query($ db," SELECT * FROM car as c where where not EXISTS( SELECT * FROM预订为b WHERE c.car_id = b.car_id AND b.drop_date< =' $ date' AND b.pickup_date> =' $ date')");