<?php
$con=mysqli_connect("localhost","root","root","test");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$results = mysqli_query($con,"SELECT SUM(jumlah) AS jumlah_sum FROM finance_income");
echo '<center>';
while($rows = mysqli_fetch_array($results));
{
echo "<p>" . "Rp " . number_format($rows['jumlah_sum']) . "</p>";
}
echo "</center>";
mysqli_close($con);
?>
我已经更改了一些代码,但是当我打开这个 php 文件时,它并没有添加我所有的号码,它只是在网络上打印 0 有人知道会发生什么吗?
Full texts
id
timestamp
nama
cat_id
jumlah
1
2013-10-26 14:08:18
test
Iuran
400000
2
2013-10-26 22:06:35
test
Donasi
2000000
3
2013-10-27 10:51:32
test
Iuran
100000
4
2013-10-27 10:55:01
test
Iuran
100000
5
2013-10-27 11:01:38
test
Iuran
100000
6
2013-10-27 11:02:07
test
Iuran
100000
那是我的数据库谢谢你,瑞恩