Update Scoreboard - ASP

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

Update Scoreboard - ASP

 
0
  #1
Oct 24th, 2006
Hello,

I am facing a problem in ASP. The scenario is...

I have a database with the following Colums and the data type of all Colums are integer

id|score1 | score2 | score3
------------------------------------
1 | 10 | 4 | 10 |
2 | 5 | 51 | 10 |
3 | 5 | 22 | 10 |
4 | 15 | 54 | 10 |
5 | 7 | 11 | 10 |
6 | 19 | 2 | 10 |
7 | 10 | 1 | 10 |
8 | 12 | 66 | 10 |
9 | 3 | 75 | 10 |
10| 7 | 11 | 10 |



Now, I have a page (search_result.asp) where I can search for scores based on the ids, and each result has a corresponding checkbox (so that I can increase the number of score of a particular ID or multiple IDs )

I have a second page (update_scrore.asp) where I have 3 textboxes where I can enter scores and at the click of a button these scores are added to the selected ID.


I can make it work perfectly fine when It comes to just one score update at a time. But I cannot figure out how to add the score if I am selecting multiple checkboxes i.e. multiple IDs.


For Eg. If I am selecting the checkbox containing the ID 8, and I want to add 30 scores in each 3 colums, the updated value will be 42 | 96 | 40

But I cannot figure out, how should I add and update the colums If I am selecting multiple IDs i.e. 7, 5, 9


I am new to ASP, so please help.


Thanx in Advance....


God Bless
Last edited by cancer10; Oct 24th, 2006 at 8:55 am.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 483
Reputation: campkev is an unknown quantity at this point 
Solved Threads: 19
campkev campkev is offline Offline
Posting Pro in Training

Re: Update Scoreboard - ASP

 
0
  #2
Oct 25th, 2006
  1. update TABLENAME set
  2. score1 = score1+30,
  3. score2=score2+30,
  4. score3 =score3+30
  5. where id in (7,5,9)
Reply With Quote Quick reply to this message  
Reply

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


Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC