コード例 #1
0
ファイル: dbpostgresql.php プロジェクト: bash-t/admidio
 /** Read the last error from the database and call the parent method to display
  *  this error to the user.
  *  @param $code    Optional you could set a code that should be displayed to the user.
  *                  Per default the database error code will be read and displayed.
  *  @param $message Optional you could set a message that should be displayed to the user.
  *                  Per default the database error message will be read and displayed.
  *  @return Will exit the script and returns a html output with the error informations.
  */
 public function db_error($code = 0, $message = '')
 {
     if ($code === 0) {
         parent::db_error(1, @pg_last_error());
     } else {
         parent::db_error($code, $message);
     }
 }
コード例 #2
0
ファイル: dbmysql.php プロジェクト: bash-t/admidio
 /** Read the last error from the database and call the parent method to display
  *  this error to the user.
  *  @param $code    Optional you could set a code that should be displayed to the user.
  *                  Per default the database error code will be read and displayed.
  *  @param $message Optional you could set a message that should be displayed to the user.
  *                  Per default the database error message will be read and displayed.
  *  @return Will exit the script and returns a html output with the error informations.
  */
 public function db_error($code = 0, $message = '')
 {
     if ($code === 0) {
         if (!$this->connectId) {
             parent::db_error(@mysql_errno(), @mysql_error());
         } else {
             parent::db_error(@mysql_errno($this->connectId), @mysql_error($this->connectId));
         }
     } else {
         parent::db_error($code, $message);
     }
 }