From:             mheuser at a-tune dot de
Operating system: Windows 2000 SP4
PHP version:      4.3.2
PHP Bug Type:     MSSQL related
Bug description:  mssql_select_db doesn't accept database names with whitespaces

Description:
------------
The mssql_select_db function does not accept any whitespaces in the
database name string nor decimal numbers at the front. If I replace the
whitespaces with something else (like _) and cut the numbers out or let
them trail the string, no error occurs and the command is performed
correctly.
The code line given in the error messages at the bottom of this page, are
actually in the PEAR::MDB package. I located the line in the source code:

if(!mssql_select_db($this->database_name, $this->connection)) {
   return($this->mssqlRaiseError());
}



Reproduce code:
---------------
$dbDatabase = "030616 [EMAIL PROTECTED] mhe";
// or
$dbDatabase = "[EMAIL PROTECTED] mhe 030616";
mssql_select_db($dbDatabase); // Connection to DBMS server was already
made successfully



Expected result:
----------------
I'd expect no error message which means a successfully selected database.

Actual result:
--------------
// Error message
Warning: mssql_select_db(): message: Zeile 1: Falsche Syntax in der Nähe
von '030616'. (severity 15) in C:\PHP\pear\MDB\mssql.php on line 417

// and for the second example
Warning: mssql_select_db(): message: Zeile 1: Falsche Syntax in der Nähe
von 'mhe'. (severity 15) in C:\PHP\pear\MDB\mssql.php on line 417

In both examples the error occurs when calling mssql_select_db (see
description on top of this page for the source code line).



-- 
Edit bug report at http://bugs.php.net/?id=24496&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=24496&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=24496&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=24496&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=24496&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=24496&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=24496&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=24496&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=24496&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=24496&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=24496&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24496&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=24496&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=24496&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=24496&r=gnused

Reply via email to