帮助:警告:mysql_fetch_array()期望参数1是资源,在第20行(和第21行)的C:\ xampp \\\\\\\\\\\\\\\\\\\\\\\\ [英] HELP: Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\connect.php on line 20 (and line 21)

查看:73
本文介绍了帮助:警告:mysql_fetch_array()期望参数1是资源,在第20行(和第21行)的C:\ xampp \\\\\\\\\\\\\\\\\\\\\\\\的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以告诉我为什么我无法通过这些警告并访问我的网页。谢谢



警告:mysql_fetch_array()要求参数1为资源,在第20行的C:\ xampp \\\\\\\\\\\\\\\\\\\\\\\\\ br $> b $ b

警告:mysql_fetch_array()期望参数1为资源,第21行的C:\ xampp \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\




Can someone please tell me why i cant get past these warnings and access my webpage. Thank you

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\connect.php on line 20

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\connect.php on line 21


$inputuser = $_POST['user'];
$inputpass = $_POST['pass'];
$user = "root";
$password = "";
$database = "gis";

$connect = mysql_connect("localhost",$user,$password);

@mysql_select_db($database) or ("Database not found");

$query = "SELECT * FROM 'users' WHERE 'user' = '$inputuser'";
$querypass = "SELECT * FROM 'users' WHERE 'password' = '$inputpass'";

$result = mysql_query($query);
$resultpass = mysql_query($querypass);

$row = mysql_fetch_array($result);
$rowpass = mysql_fetch_array($resultpass);

$serveruser = $row["user"];
$serverpass = $row["password"];

if($serveruser&&$serverpass){
	if(!$result){
		die("Username or password is invalid");
	}

	echo "Database output";
	mysql_close();

	echo $inputpass;
	echo $serverpass;

if($inputpass == $serverpass) {

	header('Location: Home.php');

}else{

	echo "Sorry that is not the correct information";
}
}

推荐答案

inputuser =
inputuser =


_POST [' user'];
_POST['user'];


inputpass =
inputpass =


这篇关于帮助:警告:mysql_fetch_array()期望参数1是资源,在第20行(和第21行)的C:\ xampp \\\\\\\\\\\\\\\\\\\\\\\\的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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