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


PHP mssql_min_error_severity函数代码示例

本文整理汇总了PHP中mssql_min_error_severity函数的典型用法代码示例。如果您正苦于以下问题:PHP mssql_min_error_severity函数的具体用法?PHP mssql_min_error_severity怎么用?PHP mssql_min_error_severity使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: connect

 /**
  * Connects to the MSSQL database.
  *
  * \param $settings
  *   An associative array with connection settings: the 'hostname',
  *   'username' and 'password' indices will be used.
  */
 function connect(array $settings)
 {
     is_array($settings) && isset($settings['hostname'], $settings['username'], $settings['password']) or trigger_error('Invalid parameters to connect()', E_USER_ERROR);
     $this->id =& mssql_pconnect($settings['hostname'], $settings['username'], $settings['password']) or trigger_error(sprintf('Could not connect to databaseserver (%s)', $settings['hostname']), E_USER_ERROR);
     // suppress warnings
     if (function_exists('mssql_min_client_severity')) {
         mssql_min_client_severity(100);
     }
     if (function_exists('mssql_min_server_severity')) {
         mssql_min_server_severity(100);
     }
     if (function_exists('mssql_min_message_severity')) {
         mssql_min_message_severity(100);
     }
     if (function_exists('mssql_min_error_severity')) {
         mssql_min_error_severity(100);
     }
 }
开发者ID:jijkoun,项目名称:ssscrape,代码行数:25,代码来源:backend.lib.php

示例2: db_connect

 function db_connect($query = "SELECT")
 {
     global $db_list, $global_db_list;
     if (!is_array($db_list)) {
         return true;
     }
     if ($this->blogs != '' && preg_match("/(" . $this->blogs . "|" . $this->users . "|" . $this->usermeta . "|" . $this->site . "|" . $this->sitemeta . "|" . $this->sitecategories . ")/i", $query)) {
         $action = 'global';
         $details = $global_db_list[mt_rand(0, count($global_db_list) - 1)];
         $this->db_global = $details;
     } elseif (preg_match("/^\\s*(alter table|create|insert|delete|update|replace) /i", $query)) {
         $action = 'write';
         $details = $db_list['write'][mt_rand(0, count($db_list['write']) - 1)];
         $this->db_write = $details;
     } else {
         $action = '';
         $details = $db_list['read'][mt_rand(0, count($db_list['read']) - 1)];
         $this->db_read = $details;
     }
     $dbhname = "dbh" . $action;
     $this->{$dbhname} = @mssql_connect($details['db_host'], $details['db_user'], $details['db_password']);
     $this->is_mysql = false;
     if (!$this->{$dbhname}) {
         $this->bail(sprintf("\n<h1>Error establishing a database connection</h1>\n<p>This either means that the username and password information in your <code>wp-config.php</code> file is incorrect or we can't contact the database server at <code>%s</code>. This could mean your host's database server is down.</p>\n<ul>\n        <li>Are you sure you have the correct username and password?</li>\n        <li>Are you sure that you have typed the correct hostname?</li>\n        <li>Are you sure that the database server is running?</li>\n</ul>\n<p>If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the <a href='http://wordpress.org/support/'>WordPress Support Forums</a>.</p>\n", $details['db_host']), 'db_connect_fail');
     }
     mssql_min_error_severity(0);
     mssql_min_message_severity(17);
     @mssql_query('SET TEXTSIZE 2147483647');
     $this->select($details['db_name'], $this->{$dbhname});
 }
开发者ID:developmentDM2,项目名称:Whohaha,代码行数:30,代码来源:mssql.php

示例3: __construct

 /**
  * MS SQL DBO driver constructor; sets SQL Server error reporting defaults
  *
  * @param array $config Configuration data from app/config/databases.php
  * @return boolean True if connected successfully, false on error
  */
 function __construct($config, $autoConnect = true)
 {
     if ($autoConnect) {
         if (!function_exists('mssql_min_message_severity')) {
             trigger_error("PHP SQL Server interface is not installed, cannot continue.  For troubleshooting information, see http://php.net/mssql/", E_USER_WARNING);
         }
         mssql_min_message_severity(15);
         mssql_min_error_severity(2);
     }
     return parent::__construct($config, $autoConnect);
 }
开发者ID:adaptivertc,项目名称:mosat,代码行数:17,代码来源:dbo_mssql.php

示例4: _connect

 /**
  * Connect to the database
  * 
  * @param string $host				The hostname the database is located at
  * @param integer $port				The port the database is at
  * @param string $user				Username for connecting
  * @param string $pass				Password for connecting
  * @param string $db				The database name
  * @param boolean $new_link			TRUE for establishing a new link to the database, FALSE to re-use an existing one
  * @param integer $client_flags		Database connection flags (see the PHP/MySQL documentation)
  * @return boolean
  */
 protected function _connect($host, $port, $user, $pass, $db, $new_link, $client_flags)
 {
     mssql_min_message_severity(QUICKBOOKS_DRIVER_SQL_MSSQL_MESSAGE_LEVEL);
     mssql_min_error_severity(QUICKBOOKS_DRIVER_SQL_MSSQL_ERROR_LEVEL);
     if ($port) {
         $this->_conn = mssql_connect($host, $user, $pass, $new_link) or die('host: ' . $host . ', user: ' . $user . ', pass: ' . $pass . ' mysql_error(): ' . mssql_get_last_message());
     } else {
         $this->_conn = mssql_connect($host . ':' . $port, $user, $pass, $new_link) or die('host: ' . $host . ', user: ' . $user . ', pass: ' . $pass . ' mysql_error(): ' . mssql_get_last_message());
     }
     return mssql_select_db($db, $this->_conn);
 }
开发者ID:dsesar,项目名称:quickbooks-php-devkit,代码行数:23,代码来源:Mssql.php

示例5: date_default_timezone_set

date_default_timezone_set('Europe/Oslo');
ini_set('log_errors', 1);
ini_set('error_log', '/var/log/php-errors.log');
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(-1);
//http://stackoverflow.com/questions/6511913/php-sql-error-message-changed-database-context
/*sqlsrv_configure ( "WarningsReturnAsErrors" , 0 ); //OFF
	sqlsrv_configure ( "LogSeverity" , 1 ); //SQLSRV_LOG_SEVERITY_ERROR*/
//http://forum.symfony-project.org/viewtopic.php?t=9958&p=40272
/**
 * MSSQL-queries may sometimes fail and mssql_last_error() returns "Changed database context to Relay441"
 * It may seem like this message is misinterpeted by PHP and it ends up as an error.
 * mssql_min_error_severity should remove those messages (and possibly others?)
 *
 * Source http://forum.symfony-project.org/viewtopic.php?t=9958&p=40272
 */
mssql_min_error_severity(16);
// TODO: Experimental!
ini_set('memory_limit', '1536M');
ini_set('mssql.timeout', 60 * 10);
$projectRoot = dirname(__DIR__);
/**
 * Autoload third party modules
 */
require dirname(__DIR__) . '/vendor/autoload.php';
require dirname(__DIR__) . '/config.php';
/*
 * Load .env file
 */
Dotenv::load($projectRoot);
开发者ID:skrodal,项目名称:relay-mediasite-harvest,代码行数:31,代码来源:bootstrap.php

示例6: db_connect

 /**
  * Connect to and select database
  *
  * @since 3.0.0
  */
 function db_connect()
 {
     // Make sure the version is the same for your ntwdblib.dll.
     // The TDS library and the ntwdblib.dll can't be speaking two different protocols.
     // note we don't OVERWRITE an existing TDSVER environment
     // a properly set up environment might have this at 8.0 or higher
     if (false === getenv('TDSVER')) {
         putenv('TDSVER=70');
     }
     // Set text limit sizes to max BEFORE connection is made
     ini_set('mssql.textlimit', 2147483647);
     ini_set('mssql.textsize', 2147483647);
     if (get_magic_quotes_gpc()) {
         $this->dbhost = trim(str_replace("\\\\", "\\", $dbhost));
     }
     if (WP_DEBUG) {
         $this->dbh = mssql_connect($this->dbhost, $this->dbuser, $this->dbpassword);
     } else {
         $this->dbh = @mssql_connect($this->dbhost, $this->dbuser, $this->dbpassword);
     }
     if (!$this->dbh) {
         $this->bail(sprintf("\n<h1>Error establishing a database connection</h1>\n<p>This either means that the username and password information in your <code>wp-config.php</code> file is incorrect or we can't contact the database server at <code>%s</code>. This could mean your host's database server is down.</p>\n<ul>\n    <li>Are you sure you have the correct username and password?</li>\n    <li>Are you sure that you have typed the correct hostname?</li>\n    <li>Are you sure that the database server is running?</li>\n</ul>\n<p>If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the <a href='http://wordpress.org/support/'>WordPress Support Forums</a>.</p>\n", $this->dbhost), 'db_connect_fail');
         return;
     }
     mssql_min_error_severity(0);
     mssql_min_message_severity(17);
     @mssql_query('SET TEXTSIZE 2147483647');
     $this->ready = true;
     $this->select($this->dbname, $this->dbh);
 }
开发者ID:jawandsingh,项目名称:wordpress_with_sql_azure,代码行数:35,代码来源:mssql.php

示例7: vty_errno

function vty_errno(){
        switch($this->vtAdi){
        case 'mysql': return mysql_errno(); break;
        case 'odbc': return odbc_error($sqlQuery); break;
        case 'mssql': return mssql_min_error_severity(); break;
        case 'postgresql': return 0; break;}
}
开发者ID:awddesign,项目名称:vty,代码行数:7,代码来源:vty.php


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