Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : Microsoft SQL Server Functions : mssql_min_message_severity

mssql_min_message_severity

Sets the lower message severity (PHP 4, PHP 5, PECL odbtp:1.1.1-1.1.4)
void mssql_min_message_severity ( int severity )

Examples ( Source code ) » mssql_min_message_severity

<?php
// Connect to MSSQL
mssql_connect('navioo\SQLEXPRESS''sa''phprt$%^');

// 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');
?>

The above example will output:

mssql_select_db(): Unable to select database:  THIS_DATABASE_DOES_NOT_EXISTS


    

Code Examples / Notes » mssql_min_message_severity

vgr

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 ;-)


jotaylor

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


Change Language


Follow Navioo On Twitter
mssql_bind
mssql_close
mssql_connect
mssql_data_seek
mssql_execute
mssql_fetch_array
mssql_fetch_assoc
mssql_fetch_batch
mssql_fetch_field
mssql_fetch_object
mssql_fetch_row
mssql_field_length
mssql_field_name
mssql_field_seek
mssql_field_type
mssql_free_result
mssql_free_statement
mssql_get_last_message
mssql_guid_string
mssql_init
mssql_min_error_severity
mssql_min_message_severity
mssql_next_result
mssql_num_fields
mssql_num_rows
mssql_pconnect
mssql_query
mssql_result
mssql_rows_affected
mssql_select_db
eXTReMe Tracker