<?php
require_once ('thaidate.php');
$sql = "SELECT data_user.*,data_car.*,data_prb.*,data_ins.* FROM data_user
left JOIN data_car on data_user.id=data_car.id
left JOIN data_prb on data_user.id=data_prb.id
left join data_ins on data_user.id=data_ins.id
WHERE DATEDIFF(CURDATE(),data_prb.prb_e,data_ins.ins_e) BETWEEN 1 AND 15
AND data_user.member_id = 'admin'
ORDER BY data_prb.prb_e and data_ins.ins_e ASC
LIMIT 30";
$query = $conn->query($sql) or die( $conn->error. "<br>$sql");
?>