嗨,我上面的这个脚本有问题......它做了事情但返回错误..它正确更改数据库但返回错误......我在某处有错误吗?
$result = mysql_query(
"INSERT INTO student (fullname, username, password, group_id)
VALUES ('$fullname', '$username', '$password', '$group_id')"
);
if ($result == 'true'){
$caturi = $group_id;
if (isset($_POST['subject'])) {
foreach ($_POST['subject'] as $cat) {
$values[] = sprintf (
"(%d, '%s')",
intval($cat),
mysql_real_escape_string($caturi)
);
}
$result2 = "INSERT INTO list (subject_a, group_a)
VALUES " . join(',', $values);
mysql_query($result2);
}
echo '<p align="center" style="color:#ccc;">Success...</p>';
}
else{
echo "Error...";
}