Please tell me where I am going wrong!
All I want to do is display a mysql count on my homepage(index.htm)
I have this code which works on another page(although that is a .php page rather than .htm)
<?php
require ($_SERVER["DOCUMENT_ROOT"] ."/conf/db_con.php");
$connection = mysql_connect ($db_host, $db_user, $db_password) or die ("error connecting");
mysql_select_db ($db_name, $connection);
$query = "SELECT count() FROM my_table WHERE postcode LIKE '%'";
$result=mysql_query ($query, $connection);
$count=mysql_result ($result,0,"count()");
echo $count;
?>
Is it the positioning of my code because it is a .html page? Is it because it is an index.html page?
As i said this code works fine on another page
😕
$count is a count of all the postcodes received. No error messages just blank
it is giving me a headache, hope someone can tell me where i am going wrong