This Weird Error With MySQL and PHP

Okay so I have a website and I have a website I am working on I’d give you all the URL, but I am trying to keep it private(ish) for now. I have no issues on the locally hosted, it works great. But not on infinity free hosting.

Fatal error: Uncaught Error: Call to a member function bind_param() on bool in /home/vol2_8/infinityfree.com/if0_34940695/htdocs/submit_post_community.php:70 Stack trace: #0 {main} thrown in /home/vol2_8/infinityfree.com/if0_34940695/htdocs/submit_post_community.php on line 70

I don’t think it’s an issue with the database, or is it? I get an error 59 or something if I have wrong details or the database doesn’t exist.

Looking up the error message, a connection issue cannot be thrown out as it occurs when prepare returns false.

Check if there’s a possibility of any of the issues here affecting the connection:

Going on a hunch since you’ve transferred from localhost, I’m suspecting this:

7 Likes

I agree with @ChrisPAR that it’s a database problem. But I suspect it’s a problem with your query, not the connection, as you wouldn’t be able to create a prepared statement if there was no connection.

So I suspect that your database connection is fine, but MySQL is rejecting the query you’ve provided, which is why mysqli_prepare or mysqli_stmt_prepare is returning false, which is why you get the “on bool” error.

This post may give you some ideas on how to handle the error reporting for this: php - MySQLi prepared statements error reporting - Stack Overflow

6 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.