Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8939559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:50:58+00:00 2026-06-15T10:50:58+00:00

I usually use my SQL Server with SQL Server Management Studio. When logging in

  • 0

I usually use my SQL Server with SQL Server Management Studio. When logging in there I use Windows Authentication and do not specify a Username/Password. So the username/password I’m using at the moment is the same I use logging onto my computer. I’m attempting to establish a connection to the server through PHP; however, I get the an error. Anyone know what I am doing wrong?

Code

    $serverName = "MYPCNAME"; 

    $connectionInfo = array( "Database"=>"College", "UID"=>"MYUSERNAME", "PWD"=>"MYPASSWORD");

    $conn = sqlsrv_connect( $serverName, $connectionInfo);

    if( $conn ) {
         echo "Connection established.<br />";
    }else{
         echo "Connection could not be established.<br />";
         die( print_r( sqlsrv_errors(), true));
    }

Error

Connection could not be established.
Array ( [0] => Array ( [0] => 28000 [SQLSTATE] => 28000 [1] => 18456 [code] => 18456 [2] => [Microsoft][SQL Server Native Client 11.0][SQL Server]Login failed for user 'MYUSERNAME'. [message] => [Microsoft][SQL Server Native Client 11.0][SQL Server]Login failed for user 'MYUSERNAME'. ) [1] => Array ( [0] => 28000 [SQLSTATE] => 28000 [1] => 18456 [code] => 18456 [2] => [Microsoft][SQL Server Native Client 11.0][SQL Server]Login failed for user 'MYUSERNAME'. [message] => [Microsoft][SQL Server Native Client 11.0][SQL Server]Login failed for user 'MYUSERNAME'. ) )
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:50:59+00:00Added an answer on June 15, 2026 at 10:50 am

    I think the problem is in your SQL Server configuration. You should have a user with SQL Server Authentication instead of Windows Authentication. Here is how https://support.gearhost.com/KB/a453/adding-users-to-mssql-using-sql-server-management-studio.aspx

    And you may also want to check if your SQL Server TCP/IP configuration is accessible remotely : http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I usually do not use Sql Server Management Studio, I usually use Linqpad to
Usually, when using Windows Authentication, the software (eg Internet Explorer) tries to use Windows
In our SQL Server 2005 database (tested using Management Studio with DBCC FREEPROCCACHE and
in Microsoft SQL Server Management Studio, I use File -> Open -> File (Ctrl
I am not used to work with SQL Server(usually I just use express). I
Usually i use SQL Server as database for my project, but one of my
I would like to export data from a SQL Server pull (usually I use
I'm using vb.net. Usually I used the SQL Server SQLComamnd but here I need
I usually use ORM instead of SQL and I am slightly out of touch
I usually use Visual Studio Team System 2008 Source Control Explorer with TFS, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.