This topic is locked

user input

7/9/2003 4:35:54 PM
ASPRunnerPro General questions
swat author

I would like to get input from my user and display my database wiht that;
let say this is my DB:
------------------------------------

Car $1000.00

Pen $500.00

-----------------------------------------
The question how much money do you have?

Input: $8000.00
then my DB will change to this
----------------------------------------------

Car $1000.00 You can buy 8

Pen $500.00 You can buy 16

---------------------------------------------------------
Any ideas.....
Thank you

swat

Admin 7/10/2003

Swat,
you can use something like this:

Amount = Request.Form("Amount")

do while not rs.eof

   Response.Write rs("ProductName") & rs("Price") & " You can buy " & CInt(Amount/rs("Price"))

   rs.MoveNext

loop


I hope this helps.
Sergey Kornilov