警告:mysql_num_rows()要求参数1为资源,布尔值在第44行的C:\ xampp \\\ ttococs \ techayotomi \register \ index.php中给出 [英] Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\techayotomi\register\index.php on line 44

查看:56
本文介绍了警告:mysql_num_rows()要求参数1为资源,布尔值在第44行的C:\ xampp \\\ ttococs \ techayotomi \register \ index.php中给出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

if(isset($ _ POST ['submit'])){



$ uname = $ _ POST ['username'];

$ password = $ _ POST ['password'];



$ sql =select * from regform where u_user ='。$ uname。'AND u_password ='。$ password。'限制1;



$ result = mysql_query($ sql);



if(mysql_num_rows($ result)){

header(location:loginform / home.php);

echo您已成功登录 ;

退出();



}

else {

echo您输入了错误的密码;

退出();

}



}

?>



我尝试了什么:



i试过if(mysql_num_rows($ result)== 1){

我也试过if(mysql_num_rows($ result)!= 1){

解决方案

_POST ['submit'])){



uname =

_POST ['username'];


if(isset($_POST['submit'])){

$uname=$_POST['username'];
$password=$_POST['password'];

$sql="select * from regform where u_user='".$uname."'AND u_password='".$password."' limit 1";

$result=mysql_query($sql);

if(mysql_num_rows($result)){
header("location:loginform/home.php");
echo " You Have Successfully Logged in";
exit();

}
else{
echo " You Have Entered Incorrect Password";
exit();
}

}
?>

What I have tried:

i have tried if(mysql_num_rows($result)==1){
and also i have tried if(mysql_num_rows($result)!=1){

解决方案

_POST['submit'])){


uname=


_POST['username'];


这篇关于警告:mysql_num_rows()要求参数1为资源,布尔值在第44行的C:\ xampp \\\ ttococs \ techayotomi \register \ index.php中给出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆