Errors:
Warning: mysqli_stmt_bind_param () expects parameter 1 to be mysqli_stmt, boolean given in /home/a9630388/public_html/register.php on line 7
Free Web Hosting
PHP Error Message
Warning: mysqli_stmt_execute () expects parameter 1 to be mysqli_stmt, boolean given in /home/a9630388/public_html/register.php on line 8
Free Web Hosting {"success": true}
Code:
<?php
$con = mysqli_connect("CONFIDENCIAL");
$email = $_POST["email"];
$senha = $_POST["senha"];
$statement = mysqli_prepare($con, "INSERT INTO user (email, senha) VALUES(?, ?)");
mysqli_stmt_bind_param($statement, "siss", $email, $senha);
mysqli_stmt_execute($statement);
$response = array();
$response["success"] = true;
echo json_encode($response);
?>
It says that the error is on line 7 and 8. Why does this appear? What is the problem?