trying to echo the rows. i dont get any errors, but it works if i do the second part.
<?php
$result = mysqli_query($db_connect, "SELECT * FROM items") or die ("Query is invalid." . mysqli_error());
if (!$row = mysqli_fetch_array($result)) {
echo "</table>".
"<font color='red'>".
"There are no items in the databse.".
"</font>";
} else {
while ($row = mysqli_fetch_array($result)) {
echo $row['Item_SKU'];
}
}
?>
this will print the first item in the db, not all of them
<?php
$result = mysqli_query($db_connect, "SELECT * FROM items") or die ("Query is invalid." . mysqli_error());
if (!$row = mysqli_fetch_array($result)) {
echo "</table>".
"<font color='red'>".
"There are no items in the databse.".
"</font>";
} else {
echo $row['Item_SKU'];
//while ($row = mysqli_fetch_array($result)) {
//
// echo $row['Item_SKU'];
//}
}
?>