Menu

#35 Unknown database error

PCG v3.0
closed-fixed
nobody
None
5
2005-05-01
2005-01-31
Anonymous
No

v3.02 for Mysql/PHP/Windows

"An Error has occurred in TESTAPP PCG Version
{APPLICATION_VERSION}
Cause of the Error : An error occured while executing
query from database.

TESTAPP PCG has stopped at this Page. Please Try again."

Steps:
--> Installed and generated an advanced application
--> Tried to use it
(1) went to a table insert page from the index page
(2) filled out the form fields, and pressed the
insert button
(3) received this generic error message

Is there some way I can view detailed error messages,
sql statements when the insert fails.

BTW: I use an autogenerated primary key.

Looking at the gendao class, there is detailed error
messaging code, but it isn't displayed. Any feedback
would be appreciated.

Thanks!
(mvording@yahoo.com)

class addressGenDAO {

function createAddress($thisAddressInfo)
{
.......

// Executing Query
$thisDatabaseQuery = new databaseQuery();
$thisDatabaseQuery->setSqlQuery($sql);
$result = $thisDatabaseQuery->executeQuery();

// Query could not execute. There was an error
if ($result == false) {

// if Error occured in Application,
handle error.
$thisError = new errorHandler();
$thisError->setUserErrorMessage("A
fatal error has occured while this application was
trying to do some operation on the database.");

$thisError->setProgramErrorMessage("Error occured when
trying to do insert on the Address Table. The SQL Query
was : ".$sql);

$thisError->setErrorPage($_SERVER['PHP_SELF']);
//overiding application settings and
quiting program on this error
$thisError->setQuitProgram(true);
$thisError->handleError();
return false;
}

Discussion

  • Nilesh Dosooye

    Nilesh Dosooye - 2005-05-01

    Logged In: YES
    user_id=398388

    in new version.. user can control verbosity of error output
    and ability to print sqls being generated as well...

     
  • Nilesh Dosooye

    Nilesh Dosooye - 2005-05-01
    • status: open --> closed-fixed
     

Log in to post a comment.