我已经拥有的以下代码完全符合我的要求,除了一件事......
date(d.added) = '$date'
我还需要登录等于$date
我已尝试将其添加到外部和WHERE语句中,但似乎无法将其正确地添加
SELECT d.*
FROM data d
WHERE date(d.added) = '$date' AND
d.logon = (SELECT MIN(d2.logon) FROM data d2 WHERE d2.name = d.name);
如果您需要更多信息,请告诉我
编辑
这是它目前的外观,但我不希望它显示结果,除非添加和登录都是相同的日期
$sql = "SELECT d.*
FROM data d
WHERE date(d.added) = '$date' AND
d.logon = (SELECT MIN(d2.logon) FROM data d2 WHERE d2.name = d.name);";
$result = $conn->query($sql);
答案 0 :(得分:0)
您尝试更改:
'$date'
到
"$date"
答案 1 :(得分:0)
请您尝试以下格式。
-webkit-appearance
您将使用以下格式
执行查询 $query="SELECT d.* FROM data d WHERE date(d.added) = '".$date."' AND d.logon = (SELECT MIN(d2.logon) FROM data d2 WHERE d2.name = d.name)";
答案 2 :(得分:0)
管理它:
SELECT d.*
FROM data d
WHERE date(d.added) = '$date' AND
d.logon = (SELECT MIN(d2.logon) FROM data d2 WHERE d2.name = d.name AND date(d2.logon) = '$date');