I am currently tasked with porting our website code onto a linux server (from Win2003). The websites run on a MS SQL database. The original dev created a wrapper to contain all interaction with the database including selecting the correct database (the application spans multiple databases) The problem code is as follows...
if (strcmp($this->_DB_Connection, $param_Database) <> 0) {
$this->_DB_Selected = @mssql_select_db($param_Database, $this->_DB_Connection);
}
Where $this->_DB_Connection is the connection to the DB server and $param_Database is the name of the database required for the next query.
The problem is that on Windows, strcmp returns 1, on linux it returns NULL.
Anyone have a work around for this that doesn't involve selecting the database each time.