View Single Post
eat1k
Senior Member
Join Date: Apr 2018
Old 02-07-2019 , 12:46   Re: insert into (or update) mysql fails because of special characters
Reply With Quote #4

PHP Code:
mysql_escape_string(dest[],len)
{
    
//copy(dest, len, source);
    
replace_all(dest,len,"\\","\\\\");
    
replace_all(dest,len,"\0","\\0");
    
replace_all(dest,len,"\n","\\n");
    
replace_all(dest,len,"\r","\\r");
    
replace_all(dest,len,"\x1a","\Z");
    
replace_all(dest,len,"'","''");
    
replace_all(dest,len,"^"","^"^"");

__________________

Last edited by eat1k; 02-07-2019 at 12:47.
eat1k is offline