Home  >  Q&A  >  body text

mysql mysql_real_escape_string() 转义问题

大家讲道理大家讲道理2766 days ago561

reply all(1)I'll reply

  • 大家讲道理

    大家讲道理2017-04-17 16:44:17

    mysql_real_escape_string escapes all special characters
    The following characters are affected:
    x00
    n
    r

    '
    "
    x1a
    If you want to escape, please escape the query parameters before bringing them into sql. Such as
    $aid = mysql_real_escape_string("14218902787457024");
    $date = mysql_real_escape_string("20170302");
    select orderid from order where date = $date AND aid ='$aid'

    reply
    0
  • Cancelreply