I can not find an error in php. Sometimes such a error:
Warning: array_walk() expects parameter 2 to be a valid callback, function \'array_sanitize\'
Try this:
function register_user($register_data) {
global $con;
array_walk($register_data, 'array_sanitize');
$register_data['password'] = md5($register_data['password']);
$fields = '`' . implode('`, `', array_keys($register_data)) . '`';
$data = '\'' . implode('\', \'', $register_data) . '\'';
$insert = "INSERT INTO users($fields) VALUES ($data) ";
mysqli_query($con,$insert);
$last_id = mysqli_insert_id($con);
$update = "UPDATE users SET url = '".$last_id."' WHERE id = ".$last_id." ";
mysqli_query($con,$update );
}
function aray_sanitize(&$item) {
$item = mysql_real_escape_string($item);
}