[thelist] Time stamping and emails

Joxn joxn at vernum.com
Sun Jul 29 12:59:10 CDT 2001


Hi Adrian,
I've done a similar thing for a banner AD system.

I store the number of views and clicks for each ad, too. These values 
and the date_accessed have to be updated when accessed, of course.

Here is my select statement:

$sql = "SELECT id, name, number_views, max_views
	FROM ads
	WHERE state='1'
	 AND (number_views < max_views OR max_views = 0)
	 AND (number_clicks < max_clicks OR max_clicks = 0)
	ORDER BY date_accessed ASC, number_views ASC, id
	LIMIT  0, 1";

BTW, max_views = 0 means unlimited in my definition and state = 1 means 
that the AD is turned on.

Hope this helps.

bye Joxn
-- 
    || //\\ \\// |\\||  ::  joxn at vernum.com  ::
  \\|| \\// //\\ ||\\|  ::      8053703      ::





More information about the thelist mailing list