我的PHP代码是这样的:从申请表,并显示HTML数据
<?php
$con=mysqli_connect("host","user","pass","db_name");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result_set = mysqli_query($con,"SELECT points FROM total WHERE id = 1");
$row = mysqli_fetch_assoc($result_set);
$old_total = $row['points'];
$new_total = $old_total + $_REQUEST['total'];
mysqli_query($con,"UPDATE total SET points = $new_total WHERE id = 1");
mysqli_close($con);
?>
所以现在我需要$ new_total我的HTML网页上显示,请帮助我。
这是最后的代码我使用:
<?php include 'something.php'; ?>
<h3> <?php echo $new_total?> </h3>