SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast Wan's Avatar
    Join Date
    Sep 2004
    Location
    kl
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Single Quotes Or Not

    Hi all! I have a problem here. I have 3 input here.
    data = Request.Form("data")
    baru = Request.Form("baru")
    kod = Request.Form("kod")
    For information, 'baru' & 'data' is string & 'kod' is numeric. The problems here is I dont know how to write sql which call this variable for numeric. This is my code. Hoe anybody can help.
    sSQL = "UPDATE jabatan SET "
    sSQL = sSQL & "jabatan = '" & baru & "',"
    sSQL = sSQL & "kod_jabatan = " & kod "
    sSQL = sSQL & "WHERE jabatan = '" & data & "'"

  2. #2
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    Egypt
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    Try this:

    Sql = "Update jabatan SET jabatan = '"&baru&"' , kod_jabatan = "&kod&" Where jabatan = '"&data&"' "
    and give a try to this too:

    sSQL = "UPDATE jabatan SET "
    sSQL = sSQL & "jabatan = '"&baru&"',"
    sSQL = sSQL & "kod_jabatan = "&kod&" "
    sSQL = sSQL & "WHERE jabatan = '" & data & "'"[/QUOTE]


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •