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