我的 sql 查询有一点问题。
在数据库中,我有发票的到期日。
保存为字符串 12-01-2013
现在我想将此日期与今天进行比较。但不工作。
这是解码。
include_once('config/connect.php');
连接数据库();
$name = $_GET['name'];
$date = date('d-m-Y');
$qry = "SELECT *, finished_invoice.date AS invoice_date FROM finished_invoice
INNER JOIN customer
ON finished_invoice.customer = customer.customer_nr
WHERE finished_invoice.user = '".$_SESSION['id']."'
AND customer.company_name = '$name'
AND expiry_date < '$date'
AND finished_invoice.sent > '0'
AND finished_invoice.paid = '0'
ORDER BY finished_invoice.id DESC"
如果有人可以帮助我。
谢谢。