e-sites / php-mysql-mysqli-wrapper

MIT License
98 stars 40 forks source link

1 passed to mysql_free_result() must be an instance of mysqli_result, boolean given #12

Open Reael opened 3 years ago

Reael commented 3 years ago

Whole Error:

Fatal error: Uncaught TypeError: Argument 1 passed to mysql_free_result() must be an instance of mysqli_result, boolean given, called in /home/httpd/[...]/functions.php on line 478 and defined in /home/httpd/[...]/mysql.php:284 Stack trace: #0 /home/httpd/[...]/functions.php(478): mysql_free_result(true) #1 /home/httpd/[...]/chat.php(25): aktualisiere_online('43', '19', 0) #2 {main} thrown in /home/httpd/[...]/mysql.php on line 284

since the site is in german: "aktualisiere_online" means "update_online"

I've been using the wrapper for our chat and if I just simply delete the line in the "function" script encountering in the error there is no error anymore, but I also can't type anything in the chat despite it running smoothly and looking all good otherwise. Now the not-being-able-to-type-issue could be somewhere else but I can't rule it out with this error. The line given in my "functions" script: @mysql_freeresult($result); - Line 478_

The line given in my "chat" script: aktualisiere_online($u_id,$oraum,0); -Line 25_

referring to this line from mysql.php mysqli_freeresult($result); - Line 284_

I have no understanding of php what so ever (the little things I know is from like 10 lessons of learning C# - 10 years ago in university), I know more or less how scripts work together but I really only need the wrapper to bypass the time till I find someone to re-write the whole chat. So if there is any solution to this I'd appreciate it if someone would explain it to me like they'd explain it to a toddler :(

MpunktMpunkt commented 3 years ago

Thx a lot for you work writing this wrapper.

I got a similiar error to the one in here: PHP Fatal error: Uncaught TypeError: Argument 1 passed to mysql_free_result() must be an instance of mysqli_result, null given

I changed #284 to this: function mysql_free_result($result)

which solved it.