php - Can't echo different from each row -
i attempting echo piece of information database. each row has different value , need able echo each value. having trouble doing so. had got working before get it.
$query = "select itemname,defindex,maxamount,sellprice,buyprice,stock,image,type pricestorage order `itemname` asc"; $result = mysqli_query($con,$query); $resultset = mysqli_fetch_array($result, mysqli_both); foreach ($resultset $id => $row) { echo $row["itemname"]; }
i know stupid, have been trying figure out couple of hours , can't.
from docs:
fetch result row associative, numeric array, or both
mysqli_fetch_array
fetchs 1 row, should like:
while($row = mysqli_fetch_array($result, mysqli_both)) { echo $row['itemname']; }
in way rows fetched in while loop , echoed, can iterate row values foreach
if that's want.
Comments
Post a Comment