SELECT id, content, UNIX_TIMESTAMP(timestamp) AS unixtime
FROM data
ORDER BY id ASC
WHERE unixtime <= CURDATE() LIMIT 10;
或者
SELECT id, content, UNIX_TIMESTAMP(timestamp) AS unixtime
FROM data
ORDER BY id ASC
WHERE unixtime < CURDATE() LIMIT 10;
所有 phpAdmin 告诉我的是:
#1064 - 您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 1 行的“WHERE unixtime <= CURDATE() LIMIT 10”附近使用正确的语法