I wrote two PHP scripts, both of which make a request to my PhpMyAdmin database. The error always occurs with the first script MySQL Database error
"Call to a member function bind_param ()"
on. I know that there are some answers to this on StackOverflow because I have come into contact with this error many times. However, it is now unclear to me why the first script works. I use different tables for this, but I paid attention to primary keys, ...
Edit PHP Code (Error):
$sql_insert=$con->prepare("INSERT INTO Users (Username,Email,Pw,Accounttype,RDate,vkey,Userterms,TFA) VALUES (?,?,?,?,?,?,?,?)");
$sql_insert->bind_param("ssssssss",$un_string,$ea_string,$pw_string_hashed,$acc_string,$date_string,$vkey,$terms,$TFA);
$sql_insert->execute();
Warning: mysqli::prepare(): Couldn't fetch mysqli in /opt/lampp/htdocs/memeon_data/register.php on line 73
Fatal error: Uncaught Error: Call to a member function bind_param() on bool in /opt/lampp/htdocs/memeon_data/register.php:74 Stack trace: #0 {main} thrown in /opt/lampp/htdocs/memeon_data/register.php on line 74
When I added mysqli_report only the above described and other uninteresting errors occurred.
I only made the two codes for comparison, are now removed again.