Hi. Im trying to get some more error messages from the mssql.dll. I somtimes get the error message "Unable to connect to server: servername". I would like to get an error message or error code from the database driver instead of the error message hard coded in the php_mssql.dll.
My problem is that I dont know C very well. There is two places in the php_mssql.c file where that error message can come from. The two places are the same the only diffrence is that one if for the persistant connection the other one the regular conect.
if ((mssql.link = dbopen(mssql.login, host)) == FAIL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to server: %s", host);
efree(hashed_details);
dbfreelogin(mssql.login);
RETURN_FALSE;
}
I would like to be able to get a message from the dbopen function when it fails. I think it should be possible when I look in a C manual for instance here, I see a errno get set.. but not sure how to retrieve it.
Any help would be apreaciated.