SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Enthusiast joeyramirez's Avatar
    Join Date
    Nov 2011
    Location
    Cabanatuan City, Philippines
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mysql_real_escape_string() on ASP

    Is there a VBScript/ASP that works like mysql_real_escape_string()???

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Oct 2001
    Location
    Vancouver BC Canada
    Posts
    2,017
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Have you checked the Funky Functions Thread?

    http://www.sitepoint.com/forums/show...nctions-in-ASP
    Andrew Wasson | www.lunadesign.org
    Principal / Internet Development

  3. #3
    SitePoint Enthusiast joeyramirez's Avatar
    Join Date
    Nov 2011
    Location
    Cabanatuan City, Philippines
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks.I'm gonna work on it.

  4. #4
    SitePoint Enthusiast joeyramirez's Avatar
    Join Date
    Nov 2011
    Location
    Cabanatuan City, Philippines
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried this code and it works.

    <%
    Dim MyVariable, SQL
    MyVariable="My name is Michael, I'm a developer"
    MyVariable =Replace(MyVariable,"'","''")
    SQL = "INSERT INTO TableName(TablefieldName) VALUES ('" & MyVariable & "')"
    %>

  5. #5
    SitePoint Wizard bronze trophy
    Join Date
    Oct 2001
    Location
    Vancouver BC Canada
    Posts
    2,017
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    I like using this one called clean quotes because it's pretty thorough: http://www.sitepoint.com/forums/show...ape#post312576

    Also here's a little library of PHP-like functions: http://www.sitepoint.com/forums/show...an#post1980880
    Andrew Wasson | www.lunadesign.org
    Principal / Internet Development

  6. #6
    SitePoint Enthusiast joeyramirez's Avatar
    Join Date
    Nov 2011
    Location
    Cabanatuan City, Philippines
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can't apply those funky functions to my page.

  7. #7
    SitePoint Wizard bronze trophy
    Join Date
    Oct 2001
    Location
    Vancouver BC Canada
    Posts
    2,017
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Here you go. This is from the second link.


    <%

    function AddSlashes(str)
    AddSlashes = replace(str,"'","''")
    end function

    Dim MyVariable, SQL
    MyVariable="My name is Michael, I'm a developer"

    MyVariable =AddSlashes(MyVariable)

    SQL = "INSERT INTO TableName(TablefieldName) VALUES ('" & MyVariable & "')"


    %>
    Andrew Wasson | www.lunadesign.org
    Principal / Internet Development

  8. #8
    SitePoint Enthusiast joeyramirez's Avatar
    Join Date
    Nov 2011
    Location
    Cabanatuan City, Philippines
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How about html tags?for example, I'm going to insert <html>,it will be added on my database ,but doesn't show on my asp page,unless you view the source.


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
  •