RE: error logging MySQL syntax errors?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In case echo mysql_error(); gives you exactly what the browser gave you,
what you need to be doing is echo'ing your SQL statement and checking if
that statement is correct.

Try your SQL statement in a query tool like phpmyadmin, but that still may
say your syntax is wrong.

Regards,
Dwight
> -----Original Message-----
> From: Kevin Murphy [mailto:php@xxxxxxxxxxxxxxxxxx]
> Sent: Friday, April 27, 2007 12:49 PM
> To: tim.mcgeary@xxxxxxxxxx
> Cc: php-db@xxxxxxxxxxxxx
> Subject: Re:  error logging MySQL syntax errors?
> 
> put:
> 
> echo mysql_error();
> 
> right after the sql query.
> 
> --
> Kevin Murphy
> Webmaster: Information and Marketing Services
> Western Nevada Community College
> www.wncc.edu
> 775-445-3326
> 
> 
> 
> On Apr 27, 2007, at 10:15 AM, Tim McGeary wrote:
> 
> > I am getting semi-ambiguous messages in the browser like:
> >
> >> You have an error in your SQL syntax; check the manual that
> >> corresponds to your MySQL server version for the right syntax to use
> >> near '' at line 4
> >
> > Is there a way in my PHP script to turn on a logging that is more
> > specific about which MySQL statement in the page is the problem?
> > "line 4" certainly doesn't help.
> >
> > Tim
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux