Counting rows in MySQL don't work
Posted: 05. November 2013 22:09
I use this code to count rows and tell if no rows is found.
This is pretty standard, right? But when using it on localhost (xampp), I always get "no rows" even if there is plenty of rows.
When using my scripts on a shared server everything works just fine! What can possibly be wrong when it's working on a
hosted shared server, but not on the latest install of xampp?
- Code: Select all
$check_tickets = mysqli_query($con,"SELECT count(*) FROM tickets");
if (mysqli_num_rows($check_tickets) > 0)
{
echo "no rows";
}
This is pretty standard, right? But when using it on localhost (xampp), I always get "no rows" even if there is plenty of rows.
When using my scripts on a shared server everything works just fine! What can possibly be wrong when it's working on a
hosted shared server, but not on the latest install of xampp?