I currently have 2 tables in my database. (will have 50 when site is complete) On the main page I will have a counter that shows the total number of records displayed on my site/in my database. I am currently able to display the number of rows in each table. I need for this number to be the total number of records in ALL tables in the database. Here is my current code.
Query:
// Query for recently added. Total # of rows in table resources
$mysqli = new mysqli("localhost","root", "", "rnddb");
$query = $mysqli->prepare("SELECT * FROM `resources`");
$query->execute();
$query->store_result();
$recentlyadded = $query->num_rows;
Display:
<?php echo $recentlyadded; // Total # of rows ?>
As of right now this gives me back the total # of rows in the resources
table. I need the query to run on all tables and give me back that number combined. Any help would be greatly appreciated! Thanks.