[PHP3/4] ms-sql server connectivity: mssql_select_db se ems to fail to set default database name

From: Date: Thu, 10 Feb 2000 02:43:34 +0000
Subject: [PHP3/4] ms-sql server connectivity: mssql_select_db se ems to fail to set default database name
Groups: php.dev 
Request: Send a blank email to php-dev+get-15343@lists.php.net to get a copy of this message
I'm wanting to use the mssql php database connectivity. I've created a wrapper class as per phplib DB_Sql protocol, implementing the functions query() and next_record() as public interface, and connect() and halt() as object internal methods. I have an issue which is: no default database name My DB_MSSQL->query() function calls DB_MSSQL->connect() My DB_MSSQL->connect() function calls mssql_connect() with server name, user name and user password, and it also calls the mssql_select_db() function with the database name. If I provide a query #1 like this: SELECT record_id, name FROM my_table my query fails and renders a diagnostic from the database server "no such object (my_table)" It requires that I use a query #2 like this: SELECT record_id, name FROM my_database.my_table I wanted to not have to be explicit about the schema (my_database) but instead use the database implicitly set by the mssql_select_db function. Is mssql_select_db supposed to set an implicit database name such that I can use a query like query #1 above? Alternatively, does anyone know of a fully develop phplib-like wrapper for the mssql_ function family of php? Thanks in advance for your help. John Harris - PHP/SQL Developer

« previous php.dev (#15343) next »