略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: mssql_min_message_severity

2024-12-22

mssql_min_message_severity

(PHP 4, PHP 5, PECL odbtp >= 1.1.1)

mssql_min_message_severitySets the minimum message severity

Warning

This function was REMOVED in PHP 7.0.0.

说明

mssql_min_message_severity ( int $severity ) : void

Sets the minimum message severity.

参数

severity

The new message severity.

返回值

没有返回值。

范例

Example #1 mssql_min_message_severity() example

<?php
// Connect to MSSQL
mssql_connect('KALLESPC\SQLEXPRESS''sa''phpfi');

// Set the minimum message severity to 17, this
// will not show any messages issued by the underlaying
// API when we select a non-existent database below
mssql_min_message_severity(17);

// Select a non-existent database
mssql_select_db('THIS_DATABASE_DOES_NOT_EXISTS');
?>

以上例程会输出:

mssql_select_db(): Unable to select database:  THIS_DATABASE_DOES_NOT_EXISTS
add a note add a note

User Contributed Notes 2 notes

up
0
jotaylor at hightechinstitute dot edu
12 years ago
The Severity Codes are:

10 - Status Message:Does not raise an error but returns a string.
11, 12, 13 - Not Used
14 - Informational Message
15 - Warning Message
16 - Critical Error: The Procedure Failed
up
0
VGR at edainworks dot com
15 years ago
very useful function to prevent the silly "message: blah blah blah" lines issued by the DB layer.

Just set the level to 17 and mssql_select_db() will (at last) leave you alone ;-)

官方地址:https://www.php.net/manual/en/function.mssql-min-message-severity.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3