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!