I am trying to create a website counter which inserts the information into my database, and displays it on my website also. I am testing it first in localhost so that is why I using localhost as my website. Here is my code.
<?php
// Connects to your Database
mysql_connect("http://localhost/counter.html", "root", "######password") or die(mysql_error());
mysql_select_db("db#####") or die(mysql_error());
//Adds one to the counter
mysql_query("UPDATE counter SET counter = counter + 1");
//Retreives the current count
$count = mysql_fetch_row(mysql_query("SELECT counter FROM counter"));
//Displays the count on your site
print "$count[0]"; ?>
and this is the is the html with the php include() I am trying to use to get the counter to appear on the website.
<head>
<title>counter test</title>
</head>
<body>
<?php include("http://localhost/counter.php"); ?>
</body>
</html>
All help greatly appreciated. Codin:rofl: