Sorry, that hasn't worked either. The code I am now using is:
<?php
$c=mysql_connect("localhost", "my_username", "my_password");
$db=mysql_select_db("my_database");
$searchForDate = date( "Y-m-d",$reqdate );
$theSQL="SELECT COUNT( DISTINCT address ) AS theIPCount FROM ez_logezboo WHERE date LIKE '$searchForDate%'";
$getIPCount=mysql_query($theSQL, $db);
$IPCount=mysql_fetch_array($getIPCount);
echo "There have been ". $IPCount["theIPCount"] ." unique visitors in this period";
mysql_close ($c);
?>
I try putting an or die command after the mysql_query function like this:
$getIPCount=mysql_query($theSQL, $db) or die("Invalid query: " . mysql_error());
But the mysql_error returns nothing.
I have moved all the code into it's own page to make sure that nothing within the main page is affecting it. I also tried echoing the SQL and that worked fine and the SQL returned the right value when I tested it in phpMyAdmin.
Within the database, the string I am trying to match follows the same pattern that I have tested, and it works fine.
Thanks,
Matthew