Hi,
I really have no idea why my if statement is showing no products when the quantity of my products is not 0, if it is then it will show no products, but the quantity of the products is more than 0. Also, there are jsut two items stored in the database. I have connected to the database and I'm sure nothing is wrong with that.
<?php
session_start();
$page = 'index.php';
mysqli_connect("host", "username", "******", "database");
function products () {
$get = mysqli_query('SELECT ID,Name,Description,Price FROM Products WHERE ID > 0 ORDER BY ID DESC ');
if (mysqli_num_rows($get) == 0) {
echo 'no products';
}
else {
echo 'success';
}
}
?>