即時得到這個錯誤:PHP腳本錯誤
Fatal error: Call to a member function query() on a non-object in C:\EasyPHP-5.3.6.0\www\Database Manager\install\registration.php on line 18
繼承人我的代碼:
<?php
include("../sql_information.php");
class infos {
private $sql_initialize;
function login_details() {
$sql_initialize = new MySQLDatabase();
$sql_initialize;
user_name='$register_user_name'";
$queryresult = $this->sql_initialize->query($sql);
if ($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;
}
}
}
?>
謝謝你現在就工作! – 2011-04-02 23:59:23