如何解决这个问题警告:mysqli_num_rows()要求参数1为mysqli_result,在C:\ xampp \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ [英] How to solve this problem warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\dealtm\customers\customer_login.php
问题描述
Hello Everyone
警告:mysqli_num_rows()要求参数1为mysqli_result,布尔值在C:\ xampp \htdocs \dealtm \customers中给出第57行\ customer_login.php
我在我的网站上面对这个问题请帮我解决这个问题
这是我的php
我尝试过:
<?php
if(isset($ _ POST ['c_login'])){
global $ db; < br $>
$ customer_email = $ _POST ['c_email'];
$ customer_pass = $ _POST ['c_pass'];
$ sel_customer =select * from customers where customer_email = $ customer_email AND customer_pass = $ customer_pass;
$ run_customer = mysqli_query($ db,$ sel_customer);
$ check_customer = mysqli_num_rows($ run_customer);
$ get_ip = getUserIP();
$ sel_cart =select * f rom cart where ip_add ='$ get_ip';
$ run_cart = mysqli_query($ con,$ sel_cart);
$ check_cart = mysqli_num_rows($ run_cart);
if($ check_customer == 0){
echoalert('电子邮件或密码不正确!,请再试一次'); ;
退出();
}
if($ check_customer == 1 AND $ check_cart = = 0){
$ _SESSION ['customer_email'] = $ customer_email;
echowinodw 。开( '客户/ my_account.php', '_自我'); ;
}
else {
include(customers / payment_option.php);
}
}
?> ;
Hello Everyone
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\dealtm\customers\customer_login.php on line 57
I am facing this probelem on my webstie please help me to solve this
Here it is my php
What I have tried:
<?php
if(isset($_POST['c_login'])){
global $db;
$customer_email = $_POST['c_email'];
$customer_pass = $_POST['c_pass'];
$sel_customer = "select * from customers where customer_email=$customer_email AND customer_pass=$customer_pass";
$run_customer = mysqli_query($db, $sel_customer);
$check_customer = mysqli_num_rows($run_customer);
$get_ip = getUserIP();
$sel_cart = "select * from cart where ip_add='$get_ip'";
$run_cart = mysqli_query($con,$sel_cart);
$check_cart = mysqli_num_rows($run_cart);
if($check_customer==0){
echo "alert('Email or Password is not correct!, Please Try Again'); ";
exit();
}
if($check_customer==1 AND $check_cart==0){
$_SESSION['customer_email']=$customer_email;
echo "winodw.open('customers/my_account.php','_self'); ";
}
else {
include ("customers/payment_option.php");
}
}
?>
推荐答案
_POST ['c_login'])){
global
_POST['c_login'])){
global
db;
db;
customer_email =
customer_email =
这篇关于如何解决这个问题警告:mysqli_num_rows()要求参数1为mysqli_result,在C:\ xampp \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!