EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
November 14, 2024, 02:26:19 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
General Discussion
>
error : Warning: mysqli_fetch_object() expects parameter 1 to be mysqli_result,
Pages: [
1
]
« previous
next »
Print
Author
Topic: error : Warning: mysqli_fetch_object() expects parameter 1 to be mysqli_result, (Read 12700 times)
joe007
Newbie
Posts: 8
error : Warning: mysqli_fetch_object() expects parameter 1 to be mysqli_result,
«
on:
July 28, 2020, 01:47:43 AM »
Hi,
I got an error on my get_user.php it tells :
Warning: mysqli_fetch_object() expects parameter 1 to be mysqli_result,
it is on command :
while($row = mysqli_fetch_object($db,$rs))
Please Help...
and my script are :
<?php
$page = isset($_POST['page']) ? intval($_POST['page']) : 1;
$rows = isset($_POST['rows']) ? intval($_POST['rows']) : 10;
$offset = ($page-1)*$rows;
$result = array();
include '../config/connection.php';
$sql="select count(*) from user";
$rs = mysqli_query($db,$sql);
$row = mysqli_fetch_row($rs);
$result["total"] = $row[0];
$rs = mysql_query("select * from user limit $offset,$rows");
$items = array();
while($row = mysqli_fetch_object($db,$rs)){
array_push($items, $row);
}
$result["rows"] = $items;
echo json_encode($result);
?>
Logged
joe007
Newbie
Posts: 8
Re: error : Warning: mysqli_fetch_object() expects parameter 1 to be mysqli_result,
«
Reply #1 on:
July 30, 2020, 09:29:14 PM »
case closed..
error because of there are 2 variables with same names ($rs)..
thx
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...