I tried to use the prepared statement for very first time. It worked fine on localhost in postgres but now not working on website. The error is always : Internal server error 500.
Following is the code
$test_query = "SELECT pid, productname FROM products WHERE pid = 1";
if(isset($_POST['submission'])){
$db_connect =new mysqli(HOST,USER,PASSWORD,DB_NAME);
$email = $_POST['emailid'];
if (!$db_connect) {
    die("Connection failed: " . mysqli_connect_error());
}else{
    echo "Connected successfully : " ;
    $stmt = $db_connect->prepare($test_query);
    $stmt->execute();
    $response=$stmt->get_result();
    if($response->num_rows>0){
        print "Hurrey!";
    }
}}
 
    