Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/62.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
与数据库的连接引发错误-分析错误:语法错误,意外'';在第19行的C:\xampp\htdocs\newlogin\forgotpass.php中_Php_Mysql - Fatal编程技术网

与数据库的连接引发错误-分析错误:语法错误,意外'';在第19行的C:\xampp\htdocs\newlogin\forgotpass.php中

与数据库的连接引发错误-分析错误:语法错误,意外'';在第19行的C:\xampp\htdocs\newlogin\forgotpass.php中,php,mysql,Php,Mysql,尝试连接到数据库-connect时,会出现以下错误:解析错误:语法错误,意外',在C:\xampp\htdocs\newlogin\forgotpass.php的第19行 <form action="" method="POST"> your email: <br /><input ="text" name="email" size"30"/><br /> <input type="submit" name="submit" value="S

尝试连接到数据库-connect时,会出现以下错误:解析错误:语法错误,意外',在C:\xampp\htdocs\newlogin\forgotpass.php的第19行

<form action="" method="POST">
your email: <br /><input ="text" name="email" size"30"/><br />
<input type="submit" name="submit" value="Submit" />
</form>

<?php
$email= $POST['email'];
$submit =$POST['submit'];
//
-->$connect= ("localhost","root","black$23");
mysql_select_db ("login_site",$connect);
if ($submit) {

    $email_check = mysql_query("SELECT * FROM users WHERE email='".$email."'");
    $count=mysql_num_rows($email_check);

    if ($count !=0){
    $random=rand(72891, 92729);
    $new_password=$random;
    $email_password=$new_password;

    require('blowfish.php');
    require('bcrypt.class.php');

    $bcrypt= new Bcrypt(4);
$new_password= $bcrypt->hash($new_password);
echo $new_password;

mysql_query("update users set password='".$new_password."'where email='".$email."'");



    }
    else{
        echo "This email does not exist.";
    }

}
?>
</body>
</html>

您的电子邮件:

第10行(
-->$connect=(“localhost”、“root”、“black$23”);
)应该是:

$connect = mysql_connect("localhost","root","black$23");

注意,
mysql\u*
函数不推荐使用,请使用
mysqli\u*
或PDOs。

mysql\u*不推荐使用。请不要再使用了。可能是第10行的
-->
?您的
if($count!=0)
语句的缩进也可以用于整理,这对我们和您都有好处。第19行是哪一行?呃<代码>$connect=(“本地主机”、“根目录”、“黑色$23”)缺少函数名。我建议您安装一个IDE,它会自动进行语法检查,帮助您快速解决这些错误。您在这段代码中也有SQL注入漏洞。