|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35148 mssql_connect does not work for username longer than 30 characters
Submitted: 2005-11-08 06:10 UTC Modified: 2005-11-08 08:20 UTC
From: diptiporwal at gmail dot com Assigned:
Status: Not a bug Package: MSSQL related
PHP Version: 4.4.1 OS: Win 2003
Private report: No CVE-ID: None
 [2005-11-08 06:10 UTC] diptiporwal at gmail dot com
Just trying to connect to MS sql server using mssql_connect, using the following line of code 

$conn = mssql_connect($DBServerName, $DBUser, $DBPassword);

If the length of variable $DBUser exceeds 30 characters, it returns the following error:login failed for user(null) : Reason : Not a trusted connection associated with SQL server was found.

Reproduce code:
$conn = mssql_connect($DBServerName, $DBUser, $DBPassword);

mssql_select_db($DBName, $conn);


Expected result:
Database connection should succeed with any length of characters below the max string length acceptable in php.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-08 08:20 UTC]
These bugs just make my day, thanks! :)
You need to blame Microsoft for them making the maximum length of the username be 30 chars (the url might break, be aware):

There just couldn't be better way to wake up than this. :)

 [2005-11-08 08:20 UTC]
And this couldn't be more bogus. :)
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 21 12:01:29 2024 UTC