Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Imported From: http://groups.google.com/group/in-portal-dev/browse_thread/thread/f984e8d7a8a1472e#

In-Portal has kDBConnection class, that can handle any type of database
interactions. When database query being executed produces an error, then
it's handled differently based on criteria listed below:   -

  • debug mode enabled AND DBG_SQL_FAILURE option set in debug.php file -

...

  • will be PHP fatal error and script

...

  • stops 

...

  • debug mode enabled AND DBG_SQL_FAILURE option not set in debug.php file

...

  • - will be PHP warning and script continues to execute

...

  • debug mode is disabled - will be PHP warning and script continues to execute

   execute
All works ok, until you need to check if last database query ended with
error with error in last 2 cases from above mentioned. 

Class kDBConnection has "getErrorCode", "getErrorMsg" and "hasError"
methods, that do the trick, but if there was a query with error before
checked query, then error isn't cleared an all methods will tell, that there
is an error, but there are none.

I propose to reset "last remembered error information" before running new
database query. 

Related Tasks

Jira Legacy
serverSystem Jira
serverId513b375f-8291-3313-9d9f-704c39b1f915
Best Regards,
http://www.in-portal.com
http://www.alex-time.com
keyINP-767