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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: diptiporwal at gmail dot com
New email:
PHP Version: OS:

 

 [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: Fri Apr 26 22:01:29 2024 UTC