ASP/SQL - Problem

Reply

Join Date: Dec 2004
Posts: 234
Reputation: cancer10 is an unknown quantity at this point 
Solved Threads: 0
cancer10's Avatar
cancer10 cancer10 is offline Offline
Posting Whiz in Training

ASP/SQL - Problem

 
0
  #1
Feb 16th, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 66
Reputation: Baradaran is an unknown quantity at this point 
Solved Threads: 4
Baradaran Baradaran is offline Offline
Junior Poster in Training

Re: ASP/SQL - Problem

 
0
  #2
Feb 16th, 2007
You have to use a random display script, so that the banners are all displayed. In order to give them a higher priority, I would create a record set, in which you have each "highest priority" banner three times, the middle priority ones two times, and the lowest priority ones one time. Then you can use a simple random banner display script. This way the highest priority is shown three times more than the lowest priority.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 234
Reputation: cancer10 is an unknown quantity at this point 
Solved Threads: 0
cancer10's Avatar
cancer10 cancer10 is offline Offline
Posting Whiz in Training

Re: ASP/SQL - Problem

 
0
  #3
Feb 28th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 66
Reputation: Baradaran is an unknown quantity at this point 
Solved Threads: 4
Baradaran Baradaran is offline Offline
Junior Poster in Training

Re: ASP/SQL - Problem

 
0
  #4
Feb 28th, 2007
This is a simple calculation, you have 10 views in total (build a table with 10 rows), 5 of them are Banner A (fill up five rows with the URL of banner A), 3 Banner B (Fill up 3 rows with Banner B), and 2 with banner c (And the two remaining with banner C. Now, each time a visitor visits this page, the next banner is shown.

Write this as a code, and there you go.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC