$sql7 = "SELECT
c.id AS id,
s.date AS date,
c.title AS title,
c.firstname AS firstname,
c.lastname AS lastname,
d.firstname AS d_firstname,
d.lastname AS d_lastname
FROM msd_schedule AS s
LEFT JOIN msd_contact AS c ON s.idCard=c.idCard
LEFT JOIN msd_doctor AS d ON d.id=s.idDoc
WHERE
(s.appointment IS NULL) AND
(DATEDIFF(s.date,NOW())=7) AND
(DATEDIFF(s.date,NOW())<=14)";
$query7 = mysql_query($sql7)or die(mysql_error());
$num7 = mysql_num_rows($query7);
จริงๆ แล้วจะต้องมี 1 record แต่มันไม่แสดงครับ ช่วยทีครับ
$sql7 = "SELECT c.id AS id,s.date AS date,c.title AS title, c.firstname AS firstname, c.lastname AS lastname, d.firstname AS d_firstname, d.lastname AS d_lastname
FROM msd_schedule AS s
LEFT JOIN msd_contact AS c ON s.idCard=c.idCard
LEFT JOIN msd_doctor AS d ON d.id=s.idDoc
WHERE (s.appointment IS NULL) AND (DATEDIFF(NOW(),s.date) between 7 AND 14 )";
$query7 = mysql_query($sql7)or die(mysql_error());
$num7 = mysql_num_rows($query7);