sybase_set_message_handler() sets a user function to
handle messages generated by the server_ You may specify the name of a
global function, or use an array to specify an object reference and a
method name_
The handler expects five arguments in the following order: message
number, severity, state, line number and description_ The first four are
integers_ The last is a string_ If the function returns FALSE, PHP
generates an ordinary error message_
Devuelve TRUE si todo se
llevó a cabo correctamente, FALSE en caso
de fallo_
Ejemplo 1_ sybase_set_message_handler() callback function
<?php
// Return FALSE from this function to indicate you can't handle
// this_ The error is printed out as a warning, the way you're used
// to it if there is no handler installed_
function msg_handler($msgnumber, $severity, $state, $line, $text) {
if (257 == $msgnumber) return FALSE;
var_dump($msgnumber, $severity, $state, $line, $text);
}
sybase_set_message_handler('msg_handler');
?>