I have an issue with PHP and mysqli, as im not really familiar with the coding language i have this issue: When i try to fill the array from row 1 to 8 the only return i get when i do print_r $items the result is 8. Not 1 to 8. Can someone help me ?
Code
$gebruiker = $_SESSION['user'];
$query = "select `item_id` from inventory where `gebruiker_id` = ?";
$stmt = $db->prepare($query);
$stmt-> bind_param('i', $gebruiker->id);
$stmt->execute();
$stmt->bind_result($item_id);
$items = array();
while ($stmt->fetch()) {
$items['item_id'] = $item_id;
}
Inventory Table
gebruiker_id | item_id
__________________________
1 | 1
1 | 2
1 | 3
1 | 4
1 | 5
1 | 6
1 | 7
1 | 8