So, this is my code:
<?php
//Connect to the database
include("config.php");
//Query the database and get the count
$result = mysql_query("SELECT * FROM ads");
$num_rows = mysql_num_rows($result);
?>
How can I make it so it query’s the database for the count every few seconds?
Save your PHP script separately (in my example below thescript.php)
Then use AJAX/javascript/jQuery in your home.php file: