My curent code, but im still getting the same error.
<?php
include("../sql_information.php");
class infos {
private $sql_initialize;
function login_details() {
$sql_initialize = new MySQLDatabase();
$sql_initialize;
$errors = array();
$register_password = mysql_real_escape_string($_POST['register_password']);
$confirm_password = mysql_real_escape_string($_POST['confirm_password']);
//escape string going to the query
$register_user_name = mysql_real_escape_string($_POST['register_user_name']);
$sql = "SELECT 1 FROM data_manager.user_accounts WHERE user_name='$register_user_name'";
$queryresult = $this->sql_initialize->query($sql);
if ($this->sql_initialize->fetchArray($queryresult)) {
$errors[] = "Username already taken";
}
if ($register_password !== $confirm_password) {
$errors[] = "Passwords mismatch";
}
if (!$errors) {
//$register_password = mysql_real_escape_string($register_password);
$sql = "INSERT INTO `data_manager`.`user_accounts` (`id`, `user_name`, `password`) VALUES (NULL, '$register_user_name', '$register_password')";
mysql_query($sql);
print "registered !";
//header("Location: complete.php");
exit;
} else {
foreach ($errors as $err) echo $err;
}
}
}
?>