0){ $list = array(); while($row = mysql_fetch_assoc($r..." />

php中怎样取出mysql一个表里的两个整形数据进行减法运算

php//连接数据库$link = mysql_connect("localhost",'user','pass');mysql_select_db("dbname",$link);$sql = "select `stu_t1`,`stu_t2` from tableName";$result = mysql_query($sql);if($result && $result > 0){ $list = array(); while($row = mysql_fetch_assoc($r...
php中怎样取出mysql一个表里的两个整形数据进行减法运算
<?php//连接数据库$link = mysql_connect("localhost",'user','pass');mysql_select_db("dbname",$link);$sql = "select `stu_t1`,`stu_t2` from tableName";$result = mysql_query($sql);if($result && $result > 0){ $list = array(); while($row = mysql_fetch_assoc($result)) { $list[] = $row['stu_t2']-$row['stu_t1']; }}print_r($list); 希望能帮到你
2013-11-15
mengvlog 阅读 51 次 更新于 2025-12-15 07:19:04 我来答关注问题0
檬味博客在线解答立即免费咨询

mySQL相关话题

Copyright © 2023 WWW.MENGVLOG.COM - 檬味博客
返回顶部