Bug fix to show mysql errors

bradymiller wrote on Friday, September 21, 2012:

Hi,

Here’s a proposed fix to show mysql errors (in many environments the mysql error is getting erased by the audit engine code, which makes it very tough to debug broken mysql queries):
http://github.com/bradymiller/openemr/commit/e5497774ef5617ab3c79cdf4f3d4afead4768963

Working well. Let me know if any thoughts/concerns/etc.

-brady
OpenEMR

bradymiller wrote on Saturday, September 22, 2012:

Hi,
Just committed this to sourceforge (master branch). Will plan to include this in the next 4.1.1 patch.
-brady
OpenEMR

yehster wrote on Thursday, October 04, 2012:

A couple of warnings that ought to be fixed here:

PHP Warning:  reset() expects parameter 1 to be array, boolean given in /var/www/openemr/library/sql.inc on line 64, referer: http://emr100/openemr/interface/main/main_screen_tab.php?auth=login&site=default

  PHP Warning:  mysql_error() expects parameter 1 to be resource, boolean given in /var/www/openemr/library/sql.inc on line 158, referer: http://emr100/openemr/interface/main/left_nav.php

yehster wrote on Thursday, October 04, 2012:

Also from the php man page on mysql_error:

Suggested alternatives

    Use of this extension is discouraged. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include:

        mysqli_error()
        PDO::errorInfo()

http://php.net/manual/en/function.mysql-error.php