INSERT INTO - form and variable in ASP page


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: INSERT INTO - form and variable in ASP page

  1. #1
    milan Guest

    INSERT INTO - form and variable in ASP page


    Hi all,
    I have this code:
    <%
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open "data"
    sql = "SELECT * FROM kong"
    Set RS = Conn.Execute(sql)
    Conn.Execute(sql)
    dim i, prod_name,
    prod_name = Request.Form ("prod_name")
    if prod_name = "ALTEA" then
    i = RS("d_al_s")
    elseif prod_name= "AMULET" then
    i = RS("d_al_w")
    end if
    %>
    where prod_name is name of form on previous ASP page and "i" is variable.
    I need put this data (prod_name, i)in database, but I dont know how write
    this code:

    "INSERT INTO kong (prod_name, discount) VALUES ('"& Request.Form ("prod_name")
    & "','" ....... & "')"

    where ...... is place for variable "i".
    Do you understand me?
    Im sorry, but my Englis is very bad.
    Thank for your help.
    Milan


  2. #2
    milan Guest

    Re: INSERT INTO - form and variable in ASP page


    Im stupid - this is OK.

    "INSERT INTO kong (prod_name, discount) VALUES ('"& Request.Form ("prod_name")
    & "',' " & i &"')"



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center