Excuse me, I forgot to say that I had already changed “i” with “s”, so now the code is:
<?php
if(isset($_GET['genere'])){
$genus =$_GET['genere'];
}
$stmt = $db->prepare("SELECT * FROM films__olon WHERE genere = ?");
$stmt->bind_param("s", $genus);
$stmt->execute();
$result = $stmt->get_result();
if($result->num_rows === 0) exit('No rows');
while ($row = $result->fetch_assoc()) {
echo "<h2>$genus</h2>";
echo "<h3>$row[titolo]</h3>";
echo "<p>$row[contenuti]</p>";
}
?>
$db point to an existing database, in which there is the table films__olon.
With the word “set” I mean what in mysql is a type (/kind) of column, like enum,tinitext,varchar and so on. And I have said above what values are in my “genere” set field (/column) stored.
EDIT
I tried with another, not “set”, field, but “varchar”.
But the result is the same: “no rows”.