List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:March 29 2002 6:54pm
Subject:Re: mysql stripslash fonction ? to escape ' ""
View as plain text  
In the last episode (Mar 29), David yahoo said:
> I know that function in php, but I generate sql from a sql queries in order
> to export some data
> from on database to another.
> 
> I make something like that :
> 
> select concat('INSERT INTO links VALUES(NULL,"99","',link.about,'","',
> ....
> from
> links,
> ...
> 
> this queries gives me sql insert command.

There is no native mysql ESCAPE() or UNESCAPE() function.  It would be
nice to have, though :)

A workaround would be SELECT ...
REPLACE(REPLACE(REPLACE(link.about,'\\','\\\\')'"','\\"'),"'","\\'")
, which will escape all quotes and backslashes in link.about.

-- 
	Dan Nelson
	dnelson@stripped
	( table, query )
Thread
mysql stripslash fonction ? to escape ' ""David yahoo29 Mar
  • Re: mysql stripslash fonction ? to escape ' ""Paul DuBois29 Mar
  • Re: mysql stripslash fonction ? to escape ' ""David yahoo29 Mar
    • Re: mysql stripslash fonction ? to escape ' ""Dan Nelson29 Mar