请帮助..每次提交数据时都会出现错误。
致命错误:未捕获错误:调用未定义函数mysql_query() C:\ xampp \ htdocs \ tmt2654 \ project2654 \ register_parse.php:12堆栈跟踪: 0 {main}在第12行的C:\ xampp \ htdocs \ tmt2654 \ project2654 \ register_parse.php中抛出
这是我的代码:
$username = $_POST['username'];
$password = $_POST['password'];
$sql = "INSERT INTO project_tmt2654.users(username, password)
VALUES ('$username', '$password');
";
$res = mysql_query($sql);
if ($res) {
echo "Successfully registered as: ".$username;
} else {
echo "Failed to register,please try again.</Br>";
echo "Mysql error: ".mysql_error();
}
答案 0 :(得分:0)