11.02.2017, 17:34
Quote:
Nope,
mysql_real_escape_string puts a \ before ', "escaping it". In this way, the query won't recognize it as the end of the argument. Example: string = "Hit 'Em Up" mysql_real_escape_string(string, result); result = "Hit \'Em Up" I think he needs displaying "result" as string, but if he's reading it from the query he'll have only "result". This means he haves to remove "\" character. You can easily do a command like: Код:
mysql_real_unescape_string(string[], result[]) { if(strcmp("\",result)) { // ... removes \ from the string. } } |
Код:
mysql_real_unescape_string(string[], result[]) { if(strcmp("\\",result)) { // ... replace "\\" with "\\\\" } }