storing a mysql query in mysql

storing a mysql query in mysql

am 17.02.2010 17:48:06 von Matt Giddings

------=_Part_116889_526634330.1266425286022
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

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

------=_Part_116889_526634330.1266425286022--

Re: Re: storing a mysql query in mysql

am 17.02.2010 18:45:59 von Ashley Sheridan

--=-0/ZQawFYqJOQJgFRcY/J
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

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



--=-0/ZQawFYqJOQJgFRcY/J--

Re: storing a mysql query in mysql

am 17.02.2010 18:47:58 von Shawn McKenzie

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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php