[PHP-DEV] [PHP3/4] ms-sql server connectivity: mssql_select_db se ems to fail to set default database name From: John Harris (jgharris <email protected>)
Date: 02/09/00

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

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>