0
更新wamp php 5.6和windows 10之後...,GROUP BY功能不起作用,在windows 7和以前的wamp工作正常。在代碼或瓦特或窗口或..中有錯,否則?GROUP BY功能不起作用
$sql = "SELECT * FROM user JOIN messages ON userID = usertwo WHERE userone = $user GROUP BY usertwo ORDER BY MAX(date) DESC LIMIT 10";
$result = $con->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
---沒有GROUP BY和()MAX不工作
但正常工作
$sql = "SELECT * FROM user JOIN messages ON userID = usertwo WHERE userone = $user ORDER BY date DESC LIMIT 10";
$result = $con->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
什麼版本的MySQL現在是你嗎? – Farkie
你不能使用*組和 –
你想要什麼結果?並顯示您的示例表數據 –