php.net |  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
21 + 24 = ?
Subscribe to this entry?

 
 [2005-11-08 06:10 UTC] diptiporwal at gmail dot com
Description:
------------
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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-08 08:20 UTC] sniper@php.net
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):

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dblibc/dbc_pdc04e_3aya.asp

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

 [2005-11-08 08:20 UTC] sniper@php.net
And this couldn't be more bogus. :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 15:01:36 2024 UTC