Re: Re: storing a mysql query in mysql
| From: | Ashley Sheridan | Date: | Wed, 17 Feb 2010 17:45:59 +0000 |
| Subject: | Re: Re: storing a mysql query in mysql | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-302162@lists.php.net to get a copy of this message | ||
On Wed, 2010-02-17 at 11:47 -0600, Shawn McKenzie wrote:
> Matt Giddings wrote:
> > Whats the best way to store a mysql query in mysql. I'm trying to store a mysql query
> > in a debug log table if there is a problem with the query. I've tried using addslashes and a
> > few other commands. I don't have a problem putting the data into the database but when I view
> > it with sqlyog its f'ed up beyond belief. Is there another/better way to store this
> > information?
> >
> > Thanks,
> > Matt
> >
>
> What's f'ed up? I mean, I know what it means, but what does it look
> like when you view it?
>
> --
> Thanks!
> -Shawn
> http://www.spidean.com
>
Don't use addslashes for entering content into the database, as it won't
guarantee the data is safe for a database. Instead, use
mysql_real_escape_string, which uses the character set of your current
connection to fix the string.
Thanks,
Ash
http://www.ashleysheridan.co.uk