showing the error is " Fatal error : Uncaught Error: Call to a member function bind_param() on bool in C:\xampp\htdocs\test\connect.php:32 Stack trace: #0 {main} thrown in C:\xampp\htdocs\test\connect.php on line 32"
AND MY CODE IS BELOW
<?php
$username = $_POST['Desired_username'];
$password = $_POST['psw'];
$secret = $_POST['Security_Question'];
$answer = $_POST['Answer'];
$name = $_POST['Name'];
$gender = $_POST['Gender'];
$age = $_POST['Age'];
$country = $_POST['country'];
$location = $_POST['Location'];
$postal = $_POST['txtOriginal'];
$area = $_POST['Area'];
$present = $_POST['Present_Address'];
$contactnumber = $_POST['Contact_Number'];
$email = $_POST['email'];
$image = $_POST['fileToUpload'];
// Database connection
$connect = new mysqli('localhost','root','','test');
if($connect->connect_error)
{
echo "$connect->connect_error";
die("Connection Failed : ". $connect->connect_error);
}
else
{
$stmt = $connect->prepare("insert into registration(Desired username,psw,Security Question,Answer,Name,Gender,Age,country,Location,txtOriginal,Area,Present Address,Contact Number,email,fileToUpload)
values(?, ?, ?, ?, ?,?, ?, ?, ?, ?,?, ?, ?, ?, ? )");
$stmt->bind_param("vvvvsissivsvivj", $username,$password,$security,$answer,$name,$gender,$age,$country,$location,$txtOriginal,$area,$present,$contactnumber,$email,$image);
$execval = $stmt->execute();
echo $execval;
echo "Registration successfully...";
$stmt->close();
$connect->close();
}
?>
PLEASE SOLVE THIS PROBLEM
