PHP如果这个数据插入成功我想弹出提示框该怎么写呢?
不让它显示1recordadded了让它弹出提示框提示’插入成功‘<?php$con=mysql_connect("localhost","root","");if(!$...
不让它显示1 record added了 让它弹出提示框提示’插入成功‘
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("t1", $con);
$sql="INSERT INTO stu(id, name, num)
VALUES('$_POST[firstname]','$_POST[lastname]','$_POST[age]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
mysql_close($con)
?> 展开
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("t1", $con);
$sql="INSERT INTO stu(id, name, num)
VALUES('$_POST[firstname]','$_POST[lastname]','$_POST[age]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
mysql_close($con)
?> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询