"SELECT * FROM sell1, post1 WHERE sell1.sell1_no = post1.post1_no AND sell1.sell1_no = post1.sell1_no AND post1.post1_datetime ORDER BY post1.post1_datetime DESC";
$date=date("Y-m-d H:i:s")
$query=mysql_query("select table1.*, table2.* from table1, table2 where table1.id = table2.id and table2.ฟิลด์ที่เก็บข้อมูลเวลาและวันที่ <='$date' order by ฟิลด์ที่เก็บข้อมูลเวลาและวันที่ asc หรือจะเป็น desc ก็ตามใจ ");
มันก็มั่วสิครับ ก็คุณเรียกมาทั้งหมดโดยไม่มีเงื่อนไขพิเศษ เงื่อนไขของคุณน่ะมันแค่ ให้เรียกข้อมูลทั้งหมดของตารางสองตารางเฉะๆๆ น่ะ
ตรง where ก็เรียกแบบนี้
where table1.ไอดีของตาราง 1 = table2.ไอดีของตาราง 2 and table1.ไอดีของตาราง1 = table2.ไอดีของตาราง 1 and table2.ฟิลด์ที่เก็บวันที่และเวลา order by ฟิลด์ที่เก็บวันที่และเวลา desc อันนี้มั้งที่เรียงจากน้อยไปหามากน่ะ หรือไม่ก็ asc ก็ลองดู
$date=date("Y-m-d H:i:s");
"SELECT * FROM sell1, post1 WHERE sell1.sell1_no = post1.post1_no AND sell1.sell1_no = post1.sell1_no AND post1.post1_datetime <='$date' ORDER BY post1.post1_datetime DESC";