ID:               42584
 Comment by:       miracle dot rpz at gmail dot com
 Reported By:      miracle dot rpz at gmail dot com
 Status:           Feedback
 Bug Type:         MSSQL related
 Operating System: *
 PHP Version:      5.2.4
 New Comment:

string(184) "mssql_select_db(): message: Could not locate entry in
sysdatabases for database 'NONEXISTEN'. No entry found with that name.
Make sure that the name is entered correctly. (severity 16)"

On *nix (with FreeTDS) after this message program exit. On Windows -
hang up. Without 'die' i have second message:

string(57) "mssql_select_db(): Unable to select database:  NONEXISTEN"


Previous Comments:
------------------------------------------------------------------------

[2008-10-04 13:25:40] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi

Using a latest 5.2 version, what error message you get when using:

<?php

function error_handler($errno, $error) {
        var_dump($error);
        die;
}    
    
set_error_handler('error_handler');
mssql_connect('correct','mssql','dsn');
mssql_select_db('NONEXISTEN');


?


Thanks.

------------------------------------------------------------------------

[2008-10-04 07:58:04] miracle dot rpz at gmail dot com

Please read my previous comment. Read it again. Link to server exists!

------------------------------------------------------------------------

[2008-10-04 03:46:23] [EMAIL PROTECTED]

This is bogus, because mssql_select_db() throws two warnings:

1) Because it cannot connect
2) Function cannot be used because no link has been made to a server

Change the error_handler() function to this and it will expose it:
function error_handler($errno, $error)
{
        echo $error, PHP_EOL;
}


mssql_select_db(): Unable to connect to server: (null)
mssql_select_db(): A link to the server could not be established

------------------------------------------------------------------------

[2007-09-07 11:48:42] miracle dot rpz at gmail dot com

Yes, this actual result from cli. Throw mod_php this code output
"hello" three times, but fopen('nonexisten.file','r'); #trigger error
handler only once.

<?php
    function error_handler() {
       die ('Hello World'.PHP_EOL);
    }    
    set_error_handler('error_handler');
    mssql_connect('correct','mssql','dsn'); #connect successfull
    mssql_select_db('NONEXISTEN'); # trigger_error
?>

after output 'Hello world' - program hung-up (mod_php & cli)

------------------------------------------------------------------------

[2007-09-07 11:05:54] [EMAIL PROTECTED]

Are you running the script on command line? (as there it's perfectly
normal to get all errors twice..)

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/42584

-- 
Edit this bug report at http://bugs.php.net/?id=42584&edit=1

Reply via email to