$id = $_REQUEST['id'];
$stmt = $conn->prepare('SELECT * FROM test WHERE id = ?');
echo $id;
$stmt->bind_param('s', $id);
$stmt->execute();
// This is line 12
while ($row = $stmt->fetch()) {
$test = $row['test'];
}
Okay here we go. This code doesn't work, cause I basically I get an error that tells me following
#0 /example/example.php(2): require()
#1 {main}
thrown in /example/example.inc.php on line 12
I don't know what I am doing wrong, but I already tried bind_result()
and $stmt->fetch_assoc()
which aren't working too. I read a lot of other questions here but they didn't help me.
Here is the connection
<?
$servername = "exase";
$username = "exaus";
$password = "exapw";
$dbname = "exa_db";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}