Jump to content

Error


carleihar

Recommended Posts

I get this error:

 

An error occurred in script '/home/content/e/q/u/equianadmin/html/htdocs/pages/my_barn.php' on line 21: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given

 

for this line of code:

 

		$row = @mysqli_fetch_array ($r, MYSQLI_NUM);

 

I've also gotten this same error for this line of code:

 

	if (mysqli_num_rows($r) == 1) {

 

What am I doing wrong? Thanks so much!

 

Link to comment
https://forums.phpfreaks.com/topic/181463-error/
Share on other sites

First time:

 

$q = "SELECT COUNT(horse_name) FROM horses WHERE user_name = {$_SESSION['username']}";
	$r = @mysqli_query ($dbc, $q);
	$row = @mysqli_fetch_array ($r, MYSQLI_NUM);

 

Second time:

 

$hn = $_GET['hn'];

$q = "SELECT CONCAT('horse_name, 'user_name') AS info FROM horses WHERE horse_name = $hn";

$r = mysqli_query ($dbc, $q);

if (mysqli_num_rows($r) == 1) {

Link to comment
https://forums.phpfreaks.com/topic/181463-error/#findComment-957389
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.