我正在尝试执行一个注册类。但是查询不起作用(查询被突出显示。这似乎是一个简单的问题,但我没有看到它。我回显查询并通过 phpmyadmin sql 查询框复制并执行它,它显示错误 1064。我似乎找不到任何问题。
<?php
class register
{
protected $username;
protected $password;
protected $email;
protected $postcode;
public function __construct()
{
}
public function insertuser($username, $password,$email, $postcode)
{
$this->_email = mysql_real_escape_string($email);
$this->_password = mysql_real_escape_string($password);
$this->_username = mysql_real_escape_string($username);
$this->_postcode = mysql_real_escape_string($postcode);
**$query = "INSERT INTO 'users'('user_id', 'username', 'password', 'email', 'postcode') VALUES (NULL,'{$username}','{$password}','{$email}','{$postcode}');";**
echo $query;
$result = mysql_query($query);
return $result;
}
}
?>