|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Scripting Help
Hi friends,
I am now on a Banner Display Program project (Php, Mysql), which displays banners on different web sites. Now the problem is with the Statistics part .I need that in such a fashion such that if we select this month say (March 2003) it should display the banner statistics such as total impressions and total clicks for each banner starting from month (1 march 2003) to (31 march 2003) displayed one by one. I had created a banner table with impressions and clicks which will be updated on each impression or click In addition to that I have one more table details with the following values recorded in it Bid (banner id) - Click (timestamp (14)) - Ip (client ip from which banner was clicked) – cid (id of each website displaying the banner) and type (0,1 (0 means impression, 1 means click)) i am adding a screen shot of this table below. Such that each impression or click will add a new record to the details table I tried to fetch the data like this $thismonthdays=Date("t" ); // this month $thisyear="2003"; $thismonth="03"; for($i=1;$i<=$thismonthdays;$i++){ $mqry="SELECT count( * ) FROM `details` WHERE click > UNIX_TIMESTAMP('$thisyear-$thismonth-$i') AND TYPE = 0"; // for impressions $qry=mysql_query($mqry)or die(mysql_error()); if($qry){ //echo($mqry."<br>" ); echo("$i-".mysql_result($qry,0)."<br>" } } but it is returning 0 for all dates.. Is there any easy way to fetch the statistics as i mentioned above. This method will insert much records in the details table ( if a site have 1000 views /day it will insert 1000 records and if 4-5 sites are used then 5x1000=5000 records per day). Am I going the right way? Can any body give me another good solution? Please help Thanks in advance Regards Praveen |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Scripting Help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|