deadliver Posted October 26, 2012 Share Posted October 26, 2012 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 Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted October 26, 2012 Share Posted October 26, 2012 An INSERT query does not return a result set, so there's nothing to free up. Only SELECT, SHOW, and EXPLAIN queries return a result set. Quote Link to comment Share on other sites More sharing options...
deadliver Posted October 27, 2012 Author Share Posted October 27, 2012 Thank you so much. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.