I am using mySQLi prepared statments to get some data from database. Problem is that I got this error. I really don't know how to fix it. Does someone knows where's the problem?
Here is code that I am using:
$editID=$_POST['productID'];
if ($stmt = $dbConnection->prepare("SELECT * FROM `kategorija-artikal` WHERE id= ? ")) {
if ($stmt->bind_param('i', $editID)===false){
die('bind_param() failed: ' . htmlspecialchars($stmt->error));
}
if ( false===$stmt->execute()) {
die('execute() failed: ' . htmlspecialchars($stmt->error));
}
$stmt->store_result();
if ($stmt->num_rows>0){
$result = $stmt->get_result();
while($row = $result->fetch_array(MYSQLI_ASSOC)) {// Fatal error
$id=$row['id'];
$name=$row['name'];
$price=$row['price'];
}
}