gpt4 book ai didi

php - 显示 MySQL 值

转载 作者:行者123 更新时间:2023-11-29 00:23:01 25 4
gpt4 key购买 nike

<分区>

我正在制作一张表格,显示一年中的所有月份及其值。

总是会显示当前年份,然后按月份显示......会有:

+------+-----+--------+--------+---------+
| YEAR | MES | ENTRY | OUTPUT | BALANCE |
+------+-----+--------+--------+---------+
| 2013 | Jan | 250.55 | -50.00 | 200.55 |
| 2013 | Feb | 0:00 |-100.00 | 100.00 |
+------+-----+--------+--------+---------+

我没有得到的是像 FEBRUARY 的例子,对于 future 可以在 BD 中完成的版本,即使你有零输入,但输出有,我无法显示。

发现这个网站,我正在尝试在线进行,请参阅:http://www.sqlfiddle.com/#!2/aa97b/2

mysql_select_db($database_conexao, $conexao);
$query_rsAnoAtualEntrada = "SELECT ID_FinanE, SUM(valor) AS SomaEntradaAtual, data FROM financ_receita WHERE YEAR(data) = ".date("Y")." GROUP BY MONTH(data)";
$rsAnoAtualEntrada = mysql_query($query_rsAnoAtualEntrada, $conexao) or die(mysql_error());
$row_rsAnoAtualEntrada = mysql_fetch_assoc($rsAnoAtualEntrada);
$totalRows_rsAnoAtualEntrada = mysql_num_rows($rsAnoAtualEntrada);


mysql_select_db($database_conexao, $conexao);
$query_rsAnoAtualSaida = "SELECT ID_FinanS, SUM(valor) AS SomaSaidaAtual, data FROM financ_despesa WHERE YEAR(data) = ".date("Y")." GROUP BY MONTH(data)";
$rsAnoAtualSaida = mysql_query($query_rsAnoAtualSaida, $conexao) or die(mysql_error());
$row_rsAnoAtualSaida = mysql_fetch_assoc($rsAnoAtualSaida);
$totalRows_rsAnoAtualSaida = mysql_num_rows($rsAnoAtualSaida);

可以吗?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com