我在这里解决我的代码时遇到问题.. 我已经看到此代码并自行编辑它,但我想更改错误消息以弹出警报,客户端在提交弹出消息后输入现有值将出现并说示例代码已在使用中
if($scode != '') {
$qry = "SELECT * FROM toxintablemonitoring WHERE sampleCode='$scode'";
$result = mysql_query($qry);
if($result) {
if(mysql_num_rows($result) > 0) {
$errmsg_arr[] = 'Sample Code already in use';
$errflag = true;
}
@mysql_free_result($result);
}
else {
die("Query failed");
}
}
if($errflag) {
$_SESSION['ERRMSG_ARR'] = $errmsg_arr;
session_write_close();
header("location: sample_input_monitoring_toxin.php");
exit();
}