21,893
社区成员
发帖
与我相关
我的任务
分享
<?php
@mysql_connect("localhost", "root", "abc123456")
or die("数据库连接失败!");
@mysql_select_db("Mytest_db")
or die("数据库不存在或不可用!");
$wno = $_POST['warrantno'];
$wname = $_POST['warrantname'];
$wlevel = $_POST['warrantlevel'];
$query_update = @mysql_query("update employees set userlevel = $wlevel where serial_no = '$wno' and emp_name = '$wname'")
or die("SQL语句执行失败!");
if($query_update)
{
echo "修改成功!<br><br>";
}
else
echo "Sorry,修改失败!";
?>
$query_update = @mysql_query("update employees set userlevel = $wlevel where serial_no = '$wno' and emp_name = '$wname'")
or die("SQL语句执行失败!");
$rc = mysql_affected_rows();
if($rc)
{
echo "修改成功!<br><br>";
}
else
echo "Sorry,修改失败!";