我的源代码是
body background=guo.JPG>
<?php
$con1=mysql_connect("localhost","guo","guo");
if($con1)
mysql_select_db("guo",$con1);
$a2="select * from jiesuan";
$a3=mysql_query($a2,$con1);
$a4=mysql_num_rows($a3);
echo "当前共有 $a4 条数据记录<br>";
echo "<table width=95% border=2 align=center>";
echo "<tr>";
echo "<th>序号</th>";
echo "<th>用途</th>";
echo "<th>金额</th>";
echo "<th>时间</th>";
echo "</tr>";
while ($a5=mysql_fetch_array($a3))
{
echo "<tr>";
echo "<td>".$a5["xh"]."</td>";
echo "<td>".$a5["yt"]."</td>";
echo "<td>".$a5["sl"]."</td>";
echo "<td>".$a5["sj"]."</td>";
echo "</tr>";
}
mysql_close($con1);
?>
</body>
</html>
现在我想将SL的和求出来,改怎么写啊
body background=guo.JPG>
<?php
$con1=mysql_connect("localhost","guo","guo");
if($con1)
mysql_select_db("guo",$con1);
$a2="select * from jiesuan";
$a3=mysql_query($a2,$con1);
$a4=mysql_num_rows($a3);
echo "当前共有 $a4 条数据记录<br>";
echo "<table width=95% border=2 align=center>";
echo "<tr>";
echo "<th>序号</th>";
echo "<th>用途</th>";
echo "<th>金额</th>";
echo "<th>时间</th>";
echo "</tr>";
while ($a5=mysql_fetch_array($a3))
{
echo "<tr>";
echo "<td>".$a5["xh"]."</td>";
echo "<td>".$a5["yt"]."</td>";
echo "<td>".$a5["sl"]."</td>";
echo "<td>".$a5["sj"]."</td>";
echo "</tr>";
}
mysql_close($con1);
?>
</body>
</html>
现在我想将SL的和求出来,改怎么写啊
解决方案 »
- 利用cookie机制来验证用户登录是不是有漏洞?
- date函数问题
- html css 怎么样 让背景色随着 滚动条一直延续下去?
- ThinkPHP的变量传递问题
- 求助!那位有php的简单注册程序
- 后端是怎么给前端传递数据的
- 头疼!头痛!紧急呼叫!请求支援!!!感激不尽!
- 一个简单的问题,像ASP.PHP的论坛,一条贴子产生以后,他的链接是不是永远不变了?
- 如果我要把一个数组保存成session,该如何写?急!急!急!
- PHP做接口,向安卓客户端提供数据,id、name等,如何实现
- php怎么根据一个表单列表中选中的项来调取另一个列表中的选项呢?
- 有一MYSQL的小问题,怎么得到指定数据的排行。
while ($a5=mysql_fetch_array($a3))
{
echo "<tr>";
echo "<td>".$a5["xh"]."</td>";
echo "<td>".$a5["yt"]."</td>";
echo "<td>".$a5["sl"]."</td>";
echo "<td>".$a5["sj"]."</td>";
echo "</tr>";
$total += $a5['sl'];
}
echo $total;