Click to See Complete Forum and Search --> : ASP/SQL - Problem


cancer10
02-16-2007, 05:35 AM
Hi,

I am designing a small advertisement management program in asp, and Sql Server 2000 as database.

My table has the following fields which are pretty self explanatory:


bannerId, bannertitle, bannerurl, imageURL, bannerpirority

bannerId = Autoincrement to generate unique id for a banner ad
bannertitle = String title of the banner
bannerurl = URL where the image is linked
imageURL = URL of the image file
bannerpirority = pirority of the banner to be displayed (1 = lowest, 5 = highest)


Now, I want to display the banner on a page based on its pirority, like if there are 3 banners A, B, C which have the pirority 1,2,3 respectively so banner C should be displayed more times as compared to banner B. Banner B should be displayed more times then banner A


Hope you got me, its like the more pirority a banner gets, the more its being displayed.


I am using the following SQl Query but I dnt think its the proper logic, can u plz help me?

select top 1 * from tbl_banner_management order by newid(), bannerpirority desc


Thanx in advance for your help.

cancer10
02-28-2007, 12:55 AM
Hi,

I have not yet received a satisfying reply so far :(

Ok lets tweak this a lil bit.

we can have a percentage based ad management system.

Like I have 3 banners in my database.

Banner A - To receive 50% Views
Banner B - To receive 30% Views
Banner C - To receive 20% Views

So suppose I refresh the page 10 times, I should get the following views of my banners

Banner A - 5 views
Banner B - 3 views
Banner C - 2 Views

Can u guys help me with this?


Thanx in advance

Sorehead
02-28-2007, 10:03 AM
http://www.w3schools.com/asp/asp_adrotator.asp

cancer10
02-28-2007, 10:08 AM
the asp adrotator does not allow me to keep a track of how many times the ad has been viewed

am I correct?

Sorehead
02-28-2007, 10:13 AM
There are different ways to keep track, if you use the adrotator component then, the banner could link to an asp page where, dependent on which banner is clicked on, you update a txt file or db table accordingly, before the user is redirected to the other site.

cancer10
02-28-2007, 10:16 AM
well thats for "how many clicks" and not "how many views"

:)