<?php
······
$result = mysql_query("SELECT SUM(fenshu) FROM chengji where kemu ='数学');
mysql_close($link);
?>以上是统计出成绩表中所有数学分数的和,我想让这个数字结果显示在text文本框中,哪位高手请指教text中的代码怎么写,上面不对的代码也请完善一遍
······
$result = mysql_query("SELECT SUM(fenshu) FROM chengji where kemu ='数学');
mysql_close($link);
?>以上是统计出成绩表中所有数学分数的和,我想让这个数字结果显示在text文本框中,哪位高手请指教text中的代码怎么写,上面不对的代码也请完善一遍
$row = mysql_fetch_array($result);<input type="text" name="abc" id="abc" value="<?php echo $row['fenshu']; ?>" />
if($result)
{
if(mysql_num_rows($result)==1)
{
$row=mysql_fetch_array($result);
}
}
<input type="text" name="abc" id="abc" value="<?php echo $row[0]; ?>" />
$result = mysql_query("SELECT SUM(fenshu) AS fenshu FROM chengji where kemu ='数学');
$row = mysql_fetch_array($result);
?>
<input type="text" name="abc" id="abc" value="<?php echo $row['fenshu']; ?>" />
$total 累加的结果
是可以,但一般很少调用CMD,几乎不。