I'm not really searching for code so much as logic. What i want to do is create a simple banner management system, which will store in a database the number of page views and number of clicks.
What would be the easiest/most efficient way to keep this in a database, i want to be able to do this weekly/daily/monthly or whatever...meaning 100 views this month, 15 clicks this month.
i'm just trying to figure out in my head how the heck to start this...any advice would be great.
Counting Banner Views
Moderator: General Moderators
Have a img code like this
and the have PHP code like
Code: Select all
<a href="jump.php?bannerid=<?php echo $id ?>"><img src="banner.jpg"></a>Code: Select all
<?php
mysql_connect("","","");
mysq_select_db("");
$sql = "SELECT count FROM banners WHERE id = {$_GETї'id']}";
list($result) = mysql_fetch_array(mysql_query($sql));
$result++;
$sql = "UPDATE banners set count = $result WHERE id = {$_GETї'id']}";
mysql_query($sql);
//Then jump to the URL
?>