$result = mysqli_query(Db::$link,"
select *
from `ka_fatora`
where DATE_format(`date`,'Y')='2017'
");
date =我希望在将其转换为(Y)之后选择值// y:年数据库中的值为1485921351。
答案 0 :(得分:1)
尝试以下MySQLi
查询
$result = mysqli_query(Db::$link,"
SELECT * FROM `ka_fatora`
WHERE DATE_FORMAT(FROM_UNIXTIME(date), "%Y")='2017'
");