ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 16th, 2007, 05:35 AM
cancer10 cancer10 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2006
Location: India
Posts: 41 cancer10 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 24 m 53 sec
Reputation Power: 12
Send a message via ICQ to cancer10 Send a message via AIM to cancer10 Send a message via MSN to cancer10 Send a message via Yahoo to cancer10
Question ASP/SQL - Problem

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?

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


Thanx in advance for your help.

Reply With Quote
  #2  
Old February 28th, 2007, 12:56 AM
cancer10 cancer10 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2006
Location: India
Posts: 41 cancer10 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 24 m 53 sec
Reputation Power: 12
Send a message via ICQ to cancer10 Send a message via AIM to cancer10 Send a message via MSN to cancer10 Send a message via Yahoo to cancer10
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
  #3  
Old March 1st, 2007, 10:22 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,886 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 19 m 35 sec
Reputation Power: 18
Perhaps I can advise on the logic of this. I would have the ASP script determine which banner to display, as opposed to using one magical SQL query.

Your algorithm for selecting the banner sounds very well thought out.

Considering statistical analysis and probability, I can't guarantee you would get 5 views, 3 views and 2 views respectively, but I vaguely remember forumals to use from high school finite classes. Unfortunately, I don't remember them well enough =(

I'm intrigued by this question.

I plan to work out some pseudo-code that might help you out, but please don't bank on my input... I tend to be extremely busy and rarely have time to do personal work (even stuff I'm excited about, like this).

If you happen to figure something out before I post back, please don't hesitate to post here!
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter!
DevArticles Forum Moderator

"The net is a waste of time, and that's exactly what's right about it." -- William Gibson

Reply With Quote
  #4  
Old March 1st, 2007, 11:31 PM
cancer10 cancer10 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2006
Location: India
Posts: 41 cancer10 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 24 m 53 sec
Reputation Power: 12
Send a message via ICQ to cancer10 Send a message via AIM to cancer10 Send a message via MSN to cancer10 Send a message via Yahoo to cancer10
Hi,

I think I have figured a way out. Assuming that I get 10 page views and in those page views I should get the following views

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

I did a simple math, so

For Banner A the math would be:

(10 x 50 ) /100 = 5

Where in 10 is the total page views and 50 is the pecentage of page views

So for banner A would get 5 page views.

I added another column in the table "ViewsLeft" which would carry the value of 5, each time Banner A gets a view, 1 will be deducted from this column "ViewsLeft"

Thats way Banner A will only get 5 views of the 10 page hits

and same process for other banners as well

Reply With Quote
  #5  
Old March 2nd, 2007, 08:32 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,886 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 19 m 35 sec
Reputation Power: 18
Quote:
(10 x 50 ) /100 = 5

Where in 10 is the total page views and 50 is the pecentage of page views


How would you know your page is going to be viewed 10 times?
I thought what you wanted was some sort of generator which decided which ad to display, how would you know how many times the page was going to be displayed?

Reply With Quote
  #6  
Old March 5th, 2007, 01:11 PM
lotressersz lotressersz is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2007
Posts: 1 lotressersz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 sec
Reputation Power: 0
Post Wow - new lottery

Hello guys I wnat present you this lottery sites: Lottery Results (URL address blocked: See forum rules) Michigan Lottery Results (URL address blocked: See forum rules) Florida Lottery Results (URL address blocked: See forum rules) Texas Lottery Results (URL address blocked: See forum rules) California Lottery Results (URL address blocked: See forum rules) Powerball Lottery Results (URL address blocked: See forum rules) PA Lottery Results (URL address blocked: See forum rules) NY Lottery Results (URL address blocked: See forum rules) Illinois Lottery Results (URL address blocked: See forum rules) Georgia Lottery Results (URL address blocked: See forum rules) What do you think? Thanks...

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > ASP/SQL - Problem


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap