我正在尝试在数据库中添加一些数据,插入后我想要一个警报,但除了 header() 函数正在工作之外它不起作用。
<?php
include("connection.php");
if(isset($_POST['submit_bank']))
{
$b_date=$_POST['bank_date'];
$b_type=$_POST['bank_type'];
$b_name=$_POST['bank_name'];
$b_bname=$_POST['bank_bname'];
$b_amount=$_POST['bank_amount'];
$result = mysql_query("INSERT INTO banking_info(b_date,b_type,b_name,b_branch,b_amount)
VALUES('$b_date','$b_type','$b_name','$b_bname','$b_amount')");
if ($result!=0)
{
echo "<script>alert('Addition Successfull !!');</script>";
header("Location: banking.php");
}
else
{
echo "<script>alert('Addition Failed !!');</script>";
header("Location: banking.php");
}
}
?>