PDA

View Full Version : Help with PHP code please


Parker Clack
12-01-2002, 02:47 PM
I have set up a routine for one of my pages that looks like

$countviews=$DB_site->query_first('SELECT SUM(views) AS totalviews FROM table');
$totalviews=number_format($countviews[totalviews]);
$monthviews = ?

echo "<p>";
echo "Total Number of Views - $totalviews";
echo "Views over last 30 days per day - $monthviews";

table in the above is the name of the table. What I need to know is what to put in monthviews line so that I get a total number of daily views over the past 30 days.

Thanks,
Parker

tHE DSS
12-01-2002, 08:46 PM
Views over the last 'x' amount of days... I don't think it's possible. Each time somthing is viewed, a timestamp isn't logged. You'd eat up huge amounts of database space if that was done.

If you are working with forum threads, then it's possible with Replies, but not views.

Parker Clack
12-01-2002, 09:03 PM
tHE DSS:

Thanks.

Parker