1

I have this PHP code:

<?php
require 'dbh.inc.php';

$sql = "SELECT * FROM productsinfo WHERE productName=?;";
$statement = mysqli_stmt_init($conn);

if (!mysqli_stmt_prepare($statement, $sql)) {
    header("Location: ../productsPage.php?error=SQLError");
    exit();
}

else {
    mysqli_stmt_bind_param($statement, "i", $_GET['productIdInvisible']);
    mysqli_stmt_execute($statement);

    $result = mysqli_stmt_get_result($statement);
    if ($row = mysqli_fetch_assoc($result)) {
        echo $row['productName'];
    } else {
        echo "problem";
    }
}

However, whenever I run it, it does not show any results whatsoever, I just get a blank screen. Please help me!

  • Possible duplicate of [How do I get PHP errors to display?](https://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display) – Dharman Oct 10 '19 at 08:01

1 Answers1

0

You should enable errors:

    error_reporting(E_ALL);
    ini_set('display_errors', 'On');

You most likely have errors which caused your script to die but cannot see them due to errors being disabled.

Thrallix
  • 699
  • 5
  • 20