So I'm passing along information from a previous form via POST array. When I attempt to pull information from the database, its not finding any records. Yet the data dump is showing that the array for "pre_fodder" has values. The array 'item' is coming up empty. Help =(
HTML
<div>
stuff here <br />
<input type="checkbox" name="pre_fodder[]" value="<? item[item_id} ?>" />
</div>
<div>
stuff here <br />
<input type="checkbox" name="pre_fodder[]" value="<? item[item_id} ?>" />
</div>
<div>
stuff here <br />
<input type="checkbox" name="pre_fodder[]" value="<? item[item_id} ?>" />
</div>
PHP
$i = 0;
$a = count($_POST['pre_fodder']);
while ( $i < $a ) {
print_r ($_POST[pre_fodder][$i]);
$_POST[pre_fodder][$i] += 0;
print_r ($_POST[pre_fodder][$i]);
$data = "SELECT * FROM items WHERE inventory_id='$_POST[pre_fodder][$i]'";
$result = mysqli_query($data);
$item = mysqli_fetch_assoc($result);
print_r($item);
$i++;
}