Prev: loadXML() and namespace
Next: Linux ERD software
From: Matt Giddings on 17 Feb 2010 11:48 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
From: Shawn McKenzie on 17 Feb 2010 12:47 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
From: Ashley Sheridan on 17 Feb 2010 12:45 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
|
Pages: 1 Prev: loadXML() and namespace Next: Linux ERD software |