<?php
include('connnect.php');
db_connect();
echo 'We\'re about to count some rows';
$query = "SELECT COUNT(*) FROM accounts";
$result = mysqli_query($mysqli,$query);
$row = $result->fetch_row();
echo $row[0];
?>
I can't seem to find out how to get the number of rows(users) in the accounts table, this code simply returns nothing. I'm not sure if I'm passing the right information into 'num_rows' or if the query that I'm using is correct.
conncet.php
Now action.php where query can be done as follows :
Full conncetion.php : link
What you ask for is pretty standard interaction with the Mysqli Result Object. One thing is the number of rows returned, and the other thing is to get the actual count value:
or