$strSQL = "SELECT * FROM store INNER JOIN drug on store.Drg_Barcode = drug.Drg_Barcode WHERE
(strtotime(store.Drg_Exp)-$date)/(60*60*24) > store.Udrg_Wnng AND store.Drg_Qtttotal > 0 order by store.Drg_Exp ";
$strSQL = "SELECT * FROM store INNER JOIN drug on store.Drg_Barcode = drug.Drg_Barcode WHERE
(strtotime(store.Drg_Exp)-{$date})/(60*60*24) > store.Udrg_Wnng AND store.Drg_Qtttotal > 0 order by store.Drg_Exp ";
ทีแรกเห็น strtotime นึกว่า MySQL function -*- Code (PHP)
$strSQL = "SELECT * FROM store INNER JOIN drug on store.Drg_Barcode = drug.Drg_Barcode WHERE ".(strtotime(store.Drg_Exp)-$date)."/(60*60*24) > store.Udrg_Wnng AND store.Drg_Qtttotal > 0 order by store.Drg_Exp ";
$strSQL = "SELECT * FROM store INNER JOIN drug on store.Drg_Barcode = drug.Drg_Barcode WHERE
( ( strtotime(store.Drg_Exp)-strtotime($date))/(60*60*24) > store.Udrg_Wnng) AND (store.Drg_Qtttotal > 0) order by store.Drg_Exp ";