Is there any function that escapes the special characters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • getmeidea
    New Member
    • Feb 2007
    • 36

    Is there any function that escapes the special characters

    Hi All,

    select '\';
    The above will give me error because mysql uses '\' as escape character.

    So i changed the query to,
    select '\\';

    Here i don't want to worry with escape character stuff. So i need a function
    which takes the parameter
    1> parameter value = '\'
    return value = '\\'
    2> parameter value = '\t'
    return value = '\t'
    2> parameter value = 'St'Johns'
    return value = 'St''Johns'

    Is there any function like this ?
  • mwasif
    Recognized Expert Contributor
    • Jul 2006
    • 802

    #2
    You can use mysql_real_esca pe_string() in PHP to escape such characters.

    Comment

    Working...