From: Dan Nelson Date: March 29 2002 6:54pm Subject: Re: mysql stripslash fonction ? to escape ' "" List-Archive: http://lists.mysql.com/mysql/104580 Message-Id: <20020329185452.GB18135@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 )