RE: What is your mysql debugging strategy?
I do something similar in my PHP applications - using an object wrapper to the SQL connection. That way, when an error occurs, the object automatically outputs the query, along with any error which was returned. Cheers, Matt > -Original Message- > From: Richard Bryson [mailto:[EMAIL PROTECTED] > Sent: 27 April 2004 22:26 > To: [EMAIL PROTECTED] > Subject: Re: What is your mysql debugging strategy? > > I only use mysql with php so all I need is > > php code: > $result = mysql_query($sql) or die(mysql_error()); > > This always tells me what I did wrong in the query. You could easily put > together a very short script into which you just drop you query. THis > would output the problem to the page. Dead simple and quick. > > Rich > > Joshua J. Kugler wrote: > > > On Tuesday 27 April 2004 04:26 am, zzapper said something like: > > > >>Even though I solved the following problem myself, I'd like to know > >>what debugging strategy people use to solve problems when they get the > >>dreaded "Error in Mysql look in the manual" > > > > > > Fire up MySQL CC and paste the SQL in there, and see what error it gives > me. > > As in 'You have an error near' type messages. > > > > j- k- > > > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: What is your mysql debugging strategy?
On 27-Apr-2004 zzapper wrote: > On Tue, 27 Apr 2004 22:26:16 +0100, wrote: > >>I only use mysql with php so all I need is >> >>php code: >>$result = mysql_query($sql) or die(mysql_error()); >> >>This always tells me what I did wrong in the query. You could easily >>put >>together a very short script into which you just drop you query. THis >>would output the problem to the page. Dead simple and quick. >> >>Rich >> >>Joshua J. Kugler wrote: >> >>> On Tuesday 27 April 2004 04:26 am, zzapper said something like: >>> Even though I solved the following problem myself, I'd like to know what debugging strategy people use to solve problems when they get the dreaded "Error in Mysql look in the manual" >>> >>> >>> Fire up MySQL CC and paste the SQL in there, and see what error it >>> gives me. >>> As in 'You have an error near' type messages. >>> >>> j- k- >>> > When I've got a horrible query with joins etc, I don't find the "your > error near .." very useful or am I giving up to easy? Howzabout : mysql_query($qry) or die(sprintf('Borked query at file %s line %d :%s', __FILE__, __LINE__, nl2br($qry)) .'' .mysql_errno() .'' .mysql_error()); -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: What is your mysql debugging strategy?
On Tue, 27 Apr 2004 22:26:16 +0100, wrote: >I only use mysql with php so all I need is > >php code: >$result = mysql_query($sql) or die(mysql_error()); > >This always tells me what I did wrong in the query. You could easily put >together a very short script into which you just drop you query. THis >would output the problem to the page. Dead simple and quick. > >Rich > >Joshua J. Kugler wrote: > >> On Tuesday 27 April 2004 04:26 am, zzapper said something like: >> >>>Even though I solved the following problem myself, I'd like to know >>>what debugging strategy people use to solve problems when they get the >>>dreaded "Error in Mysql look in the manual" >> >> >> Fire up MySQL CC and paste the SQL in there, and see what error it gives me. >> As in 'You have an error near' type messages. >> >> j- k- >> When I've got a horrible query with joins etc, I don't find the "your error near .." very useful or am I giving up to easy? zzapper (vim, cygwin, wiki & zsh) -- vim -c ":%s/^/WhfgTNabgureRIvzSUnpxre/|:%s/[R-T]/ /Ig|:normal ggVGg?" http://www.vim.org/tips/tip.php?tip_id=305 Best of Vim Tips -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: What is your mysql debugging strategy?
I only use mysql with php so all I need is php code: $result = mysql_query($sql) or die(mysql_error()); This always tells me what I did wrong in the query. You could easily put together a very short script into which you just drop you query. THis would output the problem to the page. Dead simple and quick. Rich Joshua J. Kugler wrote: On Tuesday 27 April 2004 04:26 am, zzapper said something like: Even though I solved the following problem myself, I'd like to know what debugging strategy people use to solve problems when they get the dreaded "Error in Mysql look in the manual" Fire up MySQL CC and paste the SQL in there, and see what error it gives me. As in 'You have an error near' type messages. j- k- -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: What is your mysql debugging strategy?
On Tuesday 27 April 2004 04:26 am, zzapper said something like: > Even though I solved the following problem myself, I'd like to know > what debugging strategy people use to solve problems when they get the > dreaded "Error in Mysql look in the manual" Fire up MySQL CC and paste the SQL in there, and see what error it gives me. As in 'You have an error near' type messages. j- k- -- Joshua J. Kugler Fairbanks, Alaska Computer Consultant--Systems Designer .--- --- ... ..- .--.- ..- --. .-.. . .-. [EMAIL PROTECTED] ICQ#:13706295 Every knee shall bow, and every tongue confess, in heaven, on earth, and under the earth, that Jesus Christ is LORD -- Count on it! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]