Home | Advertising Info657 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Sunday, August 14, 2022  

  Active InfoActive Info  Display List of Info MembersMemberlist  Search The InfoSearch  HelpHelp
  RegisterRegister  LoginLogin
Classic ASP - General
 PowerASP Code Help Area : Classic ASP - General
Subject Info: Help increasing a database by x value A d d  -  P o s tAdd P o s t
Author
Message << Prev Info | Next Info >>
whega
Newbie
Newbie


Joined: November/27/2006
Online Status: Offline
Info: 3
Added: November/27/2006 at 10:38pm | IP Logged Quote whega

Hi All,

I have the following statement in an asp page:

Att_New = Current.Fields.Item("attempts").Value + 1

The above statement will work fine. However, what i actually need is for + 1 to be a value to be acquired from the form. The data is collected from the form with the line below:

insert_attempts = Request.Form("Attempts")

Does anyone know how to code this line to that Att_New = current database value + new value acquired from the form.

Any help is appreciated. Thank you.

 

Back to Top View whega's Profile Search for other info by whega
 
firas_TheGeek
Newbie
Newbie
Avatar

Joined: May/27/2006
Location: Oman
Online Status: Offline
Info: 28
Added: November/28/2006 at 5:17am | IP Logged Quote firas_TheGeek

Hi,

 

Could you please explain better. Cause im not sure i got what you are talking about.

 

 

Best Regards

Firas S Assaad



__________________
Firas S Assaad (TheGeek)
firas489@gmail.com
0096892166434
http://firas-thegeek.blogspot.com
Back to Top View firas_TheGeek's Profile Search for other info by firas_TheGeek Visit firas_TheGeek's Homepage
 
whega
Newbie
Newbie


Joined: November/27/2006
Online Status: Offline
Info: 3
Added: November/28/2006 at 2:27pm | IP Logged Quote whega

Thanks for the response,

What I am trying to do is add the value submitted via the form to the value currently in the database.

For example, in the database, I have a field called attempts and the current value of this field is 10. I then have a form to update this field. If some selects 10 on the form and submits it, i want to add the both values together to that i can update the database with this new total.

Hope this explained it a little better

Back to Top View whega's Profile Search for other info by whega
 
whega
Newbie
Newbie


Joined: November/27/2006
Online Status: Offline
Info: 3
Added: November/28/2006 at 5:30pm | IP Logged Quote whega

Got this fixed. I just added another field in the table to hold the value from the form. I was then able to use the following command

Att_New = Current.Fields.Item("attempts").Value + Current.Fields.Item("temp_att").Value

 

And this worked just fine. Probably not the best way to do business but it works.

Thanks all

Back to Top View whega's Profile Search for other info by whega
 
firas_TheGeek
Newbie
Newbie
Avatar

Joined: May/27/2006
Location: Oman
Online Status: Offline
Info: 28
Added: November/28/2006 at 11:32pm | IP Logged Quote firas_TheGeek

Hi,

Just to make that i understood you 100%

If there is a field in the database that has the value of 10 and a user submits a value of 5 in order to add this value with the value in the field in the database, then after submitting that field will end up to have the value of 15 right??

if yes, then i dont think what you did in the last post works

use this instead:

Current.Fields.Item("attempts").Value = Current.Fields.Item("attempts").Value + request("THE_FIELD_NAME_IN_THE_FORM_THE_USER_WOULD_SUBMIT")

 

 

Hope this help.

If not, please let me know.

 

 

Best Regards

Firas S Assaad



__________________
Firas S Assaad (TheGeek)
firas489@gmail.com
0096892166434
http://firas-thegeek.blogspot.com
Back to Top View firas_TheGeek's Profile Search for other info by firas_TheGeek Visit firas_TheGeek's Homepage
 

If you wish to make a comment to this info you must first login
If you are not already registered you must first register

  A d d  -  P o s tAdd P o s t
Printable version Printable version

Info Jump
You cannot add new info in this area
You cannot add to info in this area
You cannot delete your info in this area
You cannot edit your info in this area
You cannot create polls in this area
You cannot vote in polls in this area

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright 1998 - 2022 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

vbscript active server pages ASP vbscript SQL database informix oracle SQL Server Perl CGI Delphi PHP source code code sample samples program CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.cjwsoft.com,www.aspclassifieds.com,www.aspphotogallery.com