note 51015 added to function.mssql-select-db

From: Date: Wed, 16 Mar 2005 18:55:10 +0000
Subject: note 51015 added to function.mssql-select-db
Groups: php.notes 
Request: Send a blank email to php-notes+get-86564@lists.php.net to get a copy of this message
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. ---- Manual Page -- http://www.php.net/manual/en/function.mssql-select-db.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+51015 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51015&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51015&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51015&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51015&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51015&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+51015&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#86564) next »