当前位置: 首页>>代码示例>>PHP>>正文


PHP PMF_Db::errorPage方法代码示例

本文整理汇总了PHP中PMF_Db::errorPage方法的典型用法代码示例。如果您正苦于以下问题:PHP PMF_Db::errorPage方法的具体用法?PHP PMF_Db::errorPage怎么用?PHP PMF_Db::errorPage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PMF_Db的用法示例。


在下文中一共展示了PMF_Db::errorPage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: connect

 /**
  * Connects to the database.
  *
  * This function connects to a MySQL database
  *
  * @param   string $host
  * @param   string $username
  * @param   string $password
  * @param   string $db_name
  * @return  boolean TRUE, if connected, otherwise FALSE
  * @access  public
  * @author  Adam Greene <phpmyfaq@skippy.fastmail.fm>
  * @since   2004-12-10
  */
 function connect($host, $user, $passwd, $db)
 {
     $this->conn = @sybase_pconnect($host, $user, $passwd);
     if (empty($db) || $this->conn === false) {
         PMF_Db::errorPage('An unspecified error occurred.');
         die;
     }
     return @sybase_select_db($db, $this->conn);
 }
开发者ID:noon,项目名称:phpMyFAQ,代码行数:23,代码来源:Sybase.php

示例2: connect

 /**
  * Connects to the database.
  *
  * This function connects to a ibase database
  *
  * @param   string $host
  * @param   string $username
  * @param   string $password
  * @param   string $db_name
  * @return  boolean true, if connected, otherwise false
  * @access  public
  * @author  Thorsten Rinne <thorsten@phpmyfaq.de>
  * @since   2005-04-16
  */
 function connect($host, $user, $passwd, $db)
 {
     $this->conn = ibase_connect($db, $user, $passwd);
     if (false == $this->conn) {
         PMF_Db::errorPage(ibase_errmsg());
         die;
     }
     return true;
 }
开发者ID:noon,项目名称:phpMyFAQ,代码行数:23,代码来源:Ibase.php

示例3: connect

 /**
  * Connects to the database.
  *
  * @param   string $host
  * @param   string $username
  * @param   string $password
  * @param   string $db_name
  * @return  boolean TRUE, if connected, otherwise FALSE
  */
 function connect($host, $user, $passwd, $db)
 {
     $this->conn = mssql_pconnect($host, $user, $passwd);
     if (empty($db) or $this->conn == false) {
         PMF_Db::errorPage(mssql_get_last_message());
         die;
     }
     return mssql_select_db($db, $this->conn);
 }
开发者ID:atlcurling,项目名称:tkt,代码行数:18,代码来源:Mssql.php

示例4: connect

 /**
  * This function connects to a DB2 database
  *
  * @param   string $host
  * @param   string $username
  * @param   string $password
  * @param   string $db_name
  * @return  boolean TRUE, if connected, otherwise FALSE
  * @access  public
  * @author  Thorsten Rinne <thorsten@phpmyfaq.de>
  * @since   2005-04-16
  */
 function connect($host, $user, $passwd, $db)
 {
     $this->conn = db2_pconnect($db, $user, $passwd, $this->options);
     if (false == $this->conn) {
         PMF_Db::errorPage(db2_conn_errormsg());
         die;
     }
     return true;
 }
开发者ID:nosch,项目名称:phpMyFAQ,代码行数:21,代码来源:Ibm_db2.php

示例5: connect

 /**
  * Connects to the database.
  *
  * This function connects to a MySQL database
  *
  * @param   string $host
  * @param   string $username
  * @param   string $password
  * @param   string $db_name
  * @return  boolean true, if connected, otherwise false
  * @access  public
  * @author  Thorsten Rinne <thorsten@phpmyfaq.de>
  * @since   2005-02-21
  */
 public function connect($host, $user, $passwd, $db)
 {
     $this->conn = new mysqli($host, $user, $passwd, $db);
     if (mysqli_connect_errno()) {
         PMF_Db::errorPage(mysqli_connect_error());
         die;
     }
     return true;
 }
开发者ID:noon,项目名称:phpMyFAQ,代码行数:23,代码来源:Mysqli.php

示例6: connect

 /**
  * Connects to the database.
  *
  * This function connects to a MySQL database
  *
  * @param  string  $host     Hostname
  * @param  string  $username Username
  * @param  string  $password Password
  * @param  string  $db_name  Database name
  * @return boolean TRUE, if connected, otherwise false
  */
 public function connect($host, $user, $password, $db)
 {
     $this->conn = mysql_connect($host, $user, $password);
     if (empty($db) || $this->conn == false) {
         PMF_Db::errorPage($this->error());
         die;
     }
     return mysql_select_db($db, $this->conn);
 }
开发者ID:noon,项目名称:phpMyFAQ,代码行数:20,代码来源:Mysql.php

示例7: connect

 /**
  * Connects to the database.
  *
  * @param   string
  * @return  boolean
  */
 public function connect($host, $user = false, $passwd = false, $db = false)
 {
     $this->conn = new SQLite3($host);
     if (!$this->conn) {
         PMF_Db::errorPage($this->conn->lastErrorMsg());
         die;
     }
     return true;
 }
开发者ID:atlcurling,项目名称:tkt,代码行数:15,代码来源:Sqlite3.php

示例8: connect

 /**
  * Connects to the database.
  *
  * @param   string
  * @return  boolean
  */
 public function connect($host, $user = false, $passwd = false, $db = false)
 {
     $this->conn = sqlite_open($host, 0666);
     if (!$this->conn) {
         PMF_Db::errorPage(sqlite_error_string(sqlite_last_error($this->conn)));
         die;
     }
     return true;
 }
开发者ID:jr-ewing,项目名称:phpMyFAQ,代码行数:15,代码来源:Sqlite.php

示例9: connect

 /**
  * Connects to the database.
  *
  * This function connects to a MySQL database
  *
  * @param  string $host     A string specifying the name of the server to which a connection is being established
  * @param  string $user     Specifies the User ID to be used when connecting with SQL Server Authentication
  * @param  string $passwd   Specifies the password associated with the User ID to be used when connecting with 
  *                          SQL Server Authentication
  * @param  string $database Specifies the name of the database in use for the connection being established
  * @return boolean true, if connected, otherwise false
  */
 public function connect($host, $user, $passwd, $database)
 {
     $this->setConnectionOptions($user, $passwd, $database);
     $this->conn = sqlsrv_connect($host, $this->connectionOptions);
     if (!$this->conn) {
         PMF_Db::errorPage(sqlsrv_errors());
         die;
     }
     return true;
 }
开发者ID:jr-ewing,项目名称:phpMyFAQ,代码行数:22,代码来源:Sqlsrv.php

示例10: connect

 /**
  * Connects to the database.
  *
  * @param   string $host
  * @param   string $username
  * @param   string $password
  * @param   string $db_name
  * @return  boolean TRUE, if connected, otherwise FALSE
  * @access  public
  * @author  Thorsten Rinne <thorsten@phpmyfaq.de>
  * @since   2005-09-20
  */
 public function connect($host, $user, $passwd, $db)
 {
     $this->conn = oci_connect($user, $passwd, $db);
     if (empty($db) or $this->conn == true) {
         $error = oci_error();
         PMF_Db::errorPage($error['message']);
         return false;
     }
     return true;
 }
开发者ID:noon,项目名称:phpMyFAQ,代码行数:22,代码来源:Oci8.php

示例11: connect

 /**
  * Connects to the database.
  *
  * @param string $host     Hostname
  * @param string $user     Username
  * @param string $password Password
  * @param string $database Database name
  *
  * @return  boolean true, if connected, otherwise false
  */
 public function connect($host, $user, $password, $database = '')
 {
     try {
         $this->conn = new PDO('mysql:host=' . $host . ';dbname=' . $database . ';charset=UTF8', $user, $password);
         $this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
     } catch (PDOException $e) {
         PMF_Db::errorPage('Database connection failed: ' . $e->getMessage());
     }
     return true;
 }
开发者ID:maggiofrancesco,项目名称:phpMyFAQ,代码行数:20,代码来源:Mysql.php

示例12: connect

 /**
  * Connects to the database.
  *
  * @param string $host     Database hostname
  * @param string $user     Database username
  * @param string $password Password
  * @param string $database Database name
  *
  * @return boolean true, if connected, otherwise false
  */
 public function connect($host, $user, $password, $database = '')
 {
     $connectionString = sprintf('host=%s port=5432 dbname=%s user=%s password=%s', $host, $database, $user, $password);
     $this->conn = pg_pconnect($connectionString);
     if (empty($database) || $this->conn == false) {
         PMF_Db::errorPage(pg_last_error($this->conn));
         die;
     }
     $this->query("SET standard_conforming_strings=on");
     return true;
 }
开发者ID:kapljr,项目名称:Jay-Kaplan-Farmingdale-BCS-Projects,代码行数:21,代码来源:Pgsql.php

示例13: connect

 /**
  * Connects to the database.
  *
  * @param   string $host
  * @param   string $user
  * @param   string $password
  * @param   string $database
  *
  * @return  boolean TRUE, if connected, otherwise FALSE
  */
 public function connect($host, $user, $password, $database = '')
 {
     $this->conn = mssql_pconnect($host, $user, $password);
     if ($this->conn === false) {
         PMF_Db::errorPage(mssql_get_last_message());
         die;
     }
     if ('' !== $database) {
         return mssql_select_db($database, $this->conn);
     }
     return true;
 }
开发者ID:maggiofrancesco,项目名称:phpMyFAQ,代码行数:22,代码来源:Mssql.php

示例14: connect

 /**
  * Connects to the database.
  *
  * This function connects to a MySQL database
  *
  * @param   string $host
  * @param   string $username
  * @param   string $password
  * @param   string $db_name
  * @return  boolean true, if connected, otherwise false
  * @access  public
  * @author  Thorsten Rinne <thorsten@phpmyfaq.de>
  * @author  Tom Rochester <tom.rochester@gmail.com>
  * @since   2003-02-24
  */
 public function connect($host, $user, $passwd, $db)
 {
     /* if you use mysql_pconnect(), remove the next line: */
     $this->conn = pg_pconnect('host=' . $host . ' port=5432 dbname=' . $db . ' user=' . $user . ' password=' . $passwd);
     /* comment out for more speed with mod_php or on Windows */
     // $this->conn = @pg_pconnect("host=$host port=5432 dbname=$db user=$user password=$passwd");
     if (empty($db) || $this->conn == false) {
         PMF_Db::errorPage(pg_last_error($this->conn));
         die;
     }
     return true;
 }
开发者ID:noon,项目名称:phpMyFAQ,代码行数:27,代码来源:Pgsql.php

示例15: connect

 /**
  * Connects to the database.
  *
  * This function connects to a MySQL database
  *
  * @param   string $host
  * @param   string $username
  * @param   string $password
  * @param   string $db_name
  * @return  boolean true, if connected, otherwise false
  */
 public function connect($host, $user, $passwd, $db)
 {
     $this->conn = new mysqli($host, $user, $passwd, $db);
     if (mysqli_connect_errno()) {
         PMF_Db::errorPage(mysqli_connect_error());
         die;
     }
     /* change character set to UTF-8 */
     if (!$this->conn->set_charset('utf8')) {
         PMF_Db::errorPage($this->error());
     }
     return true;
 }
开发者ID:atlcurling,项目名称:tkt,代码行数:24,代码来源:Mysqli.php


注:本文中的PMF_Db::errorPage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。