note 51015 deleted from function.mssql-select-db by sean

From: Date: Mon, 11 Jul 2005 16:23:27 +0000
Subject: note 51015 deleted from function.mssql-select-db by sean
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-91773@lists.php.net to get a copy of this message
Note Submitter: bharris at spro dot net ---- I had a weird issue with PEAR DB and the hang up was it's call to mssql_select_db. The numbskull who set up the database I was working on called it 'primary'...not a good idea from an SQL perspective since it's part of the SQL syntax (primary key). Trying to select primary as the DB resulted in an error returned as "No database selected" but the native error was "Incorrect syntax near the keyword 'primary'" which tipped me off. Enclosing the database name in square brackets ([primary]) fixed the issue. Spent a few hours figuring this one out...hope it helps someone else.

« previous php.notes (#91773) next »