Jump to content

Mysqli_Free_Result() Expects Parameter 1 To Be Mysqli_Result


deadliver

Recommended Posts

Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in on line 78

 

This is my first time using MYSQLI and i followed and example I found on procedural coding and it always returns this

error. I looked on the php manual online and their examples seem to be coded like this as well. Does anyone know how

I can correct this issue?

 

 

I connect to the db successfully.

 

$link = mysqli_connect(DB_HOST, DB_USER,DB_PASS,DB_NAME);
 if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
 exit();
}

 

Then I make the INSERT statement and run the query successfully

 

$players_query = "INSERT INTO `players` (id_players,player_name,player_id,clan_id,created_at,clan_name,clan_role,clan_member_since,data_updated_at)
VALUES ('','$player_name',$player_id,$clan_id,$created_at,'$clan_name','$clan_role',$clan_member_since,$updated_at)
ON DUPLICATE KEY UPDATE clan_id =$clan_id ,clan_role = '$clan_role',data_updated_at =$updated_at";
$result = mysqli_query($link,$players_query);

 

Then I verify the query ran and try to free results before the next query.

 

if($result){
echo "Player Information Updated Successfully";
 mysqli_free_result($result);
}else{
 printf("Errormessage: %s\n", mysqli_error($link));
 die();
}

 

Then I get this:

Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in on line 78

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.