Example #1
0
 /**
  * void query(Query $query, bool $goOut = true)
  *
  * Displays the query error page
  *
  * @param Query $query Query object containing query error parameters.
  * @param bool $goOut if true, execute an exit()
  * @return void
  * @access public
  */
 public static function query($query, $goOut = true)
 {
     self::message($query->getError() . " " . $query->getDbErrno() . " - " . $query->getDbError() . "." . $query->getSQL());
     if (defined("OPEN_DEBUG") && OPEN_DEBUG) {
         echo PHP_EOL . "<!-- _dbErrno = " . $query->getDbErrno() . "-->" . PHP_EOL;
         echo "<!-- _dbError = " . $query->getDbError() . "-->" . PHP_EOL;
         if ($query->getSQL() != "") {
             echo "<!-- _SQL = " . $query->getSQL() . "-->" . PHP_EOL;
         }
     }
     if ($query->getDbErrno() == 1049) {
         echo '<p><a href="../install.html">' . "Install instructions" . '</a></p>' . PHP_EOL;
     }
     if ($goOut) {
         exit($query->getError());
     }
 }