Php 如何在mysql中获取最后1小时的结束时间数据?
我在varchar数据类型中有下表字段,我想使用mysql查询从表时间中获取最后一个小时的数据 我有 PHPPhp 如何在mysql中获取最后1小时的结束时间数据?,php,mysql,codeigniter,mysqli,phpmyadmin,Php,Mysql,Codeigniter,Mysqli,Phpmyadmin,我在varchar数据类型中有下表字段,我想使用mysql查询从表时间中获取最后一个小时的数据 我有 PHP $total = (double) $input * (double) $rate; return number_format((double) $total, 2); $total = (double) $input * (double) $rate; return number_format((double) $total, 2); Jquery total = parseFl
$total = (double) $input * (double) $rate;
return number_format((double) $total, 2);
$total = (double) $input * (double) $rate;
return number_format((double) $total, 2);
Jquery
total = parseFloat(input) * parseFloat(rate);
return total.toFixed(2);
total = parseFloat(input) * parseFloat(rate);
return total.toFixed(2);
select * from `your_table_name`
where `your_column_name` between date_add(now(), interval -1 hour) and now();
PHP
$total = (double) $input * (double) $rate;
return number_format((double) $total, 2);
$total = (double) $input * (double) $rate;
return number_format((double) $total, 2);
Jquery
total = parseFloat(input) * parseFloat(rate);
return total.toFixed(2);
total = parseFloat(input) * parseFloat(rate);
return total.toFixed(2);
select * from `your_table_name`
where `your_column_name` between date_add(now(), interval -1 hour) and now();
从表中选择列值介于当前日期和时间之间且在当前时间前1小时的
datetime
行
查询
total = parseFloat(input) * parseFloat(rate);
return total.toFixed(2);
total = parseFloat(input) * parseFloat(rate);
return total.toFixed(2);
select * from `your_table_name`
where `your_column_name` between date_add(now(), interval -1 hour) and now();
用于下面的查询。
注意您的列名数据类型必须是(datetime)
提供表结构和一些示例表数据。请检查图像链接此字段数据类型varchar FORMAT表中只有一列?我需要此列的条件