|Don't ask to ask, just ask|
Mysql: need to escape column namesby jeanluca (Deacon)
|on Aug 07, 2010 at 19:35 UTC||Need Help??|
jeanluca has asked for the
wisdom of the Perl Monks concerning the following question:
I have this situation in which the user specifies the column name and definition, so I can create a table. So I have to escape both!
The only function to escape special characters I know about is quote. But this functions adds quotes around the string, which I don't need. Also the column names can have spaces so I need to add ` around them.For column names this now gives: `'my col name'`.
Any suggestions how to fix this ?