大家好,
我知道一个事实,下面看起来很愚蠢(也很有趣),但这是我在 mysql 时代曾经做过的事情(一个包含所有变量的巨大查询),我不确定这是否是即使是在 mysqli 中执行此操作的正确方法,但我肯定在这里做错了,因为此块不执行
if($query_rows == 0){
$pass_hash = hash("sha512", $reg_pass);
if($prep_stmt = $mysqli->prepare("INSERT INTO accounts (username, password, user_type,
first_name, last_name, gender, expr_rating, user_rank, rank_type, user_expr, user_legion,
num_hosted, num_attended, email, premium_status, premium_credits, location_city,
user_sex_interest) VALUES (?, ?, 0, ?, ?,
?, 0, 1, 1, 0, 1, 0, 0, ?, 0, 0, 'waterloo', ?)"))
{
// Oh my gawd -.-
$prep_stmt->bind_param("ssssisi", $reg_user, $pass_hash, $reg_fname, $reg_lname,
$reg_gender, $reg_email, $reg_sexint);
$prep_stmt->execute();
$err = $mysqli->error;
echo($err);
echo($mysqli->error);
} else {
if(DEVMODE){ // devmode is enabled
$err = $mysqli->error;
echo($err);
echo($mysqli->error);
echo("derp"); exit();
} else {
$stop = true; header("Location : error.php?id=99");
}
}
}
:P 在这里帮助一个菜鸟!谢谢大家!