我已将我的注册脚本从mysql转换为mysqli.我工作得很好,但它现在给了我错误
Commands out of sync; you can't run this command now
Run Code Online (Sandbox Code Playgroud)
这是我用来注册用户的功能
function register_user($register_data) {
global $myConnection;
array_walk($register_data, 'array_sanitize');
//Make the array readable and seperate the fields from data
$fields = '`' . implode('`, `', array_keys($register_data)) . '`';
$data = '\'' . implode('\', \'', $register_data) . '\'';
//Insert the data and email an activation email to the user
mysqli_query($myConnection, "INSERT INTO `members` ($fields) VALUES ($data)") or die(mysqli_error($myConnection));
email($register_data['mem_email'], 'Activate your account', "Hello " . $register_data['mem_first_name'] . ",\n\nThank you for creating …Run Code Online (Sandbox Code Playgroud)