php - mssql 2005

Results 1 to 8 of 8
  1. #1
    Account Upgraded | Title Enabled! joze is offline
    MemberRank
    Sep 2006 Join Date
    213213Location
    407Posts

    php - mssql 2005

    Hi, i using mssql 2005 and am having big problems with php connect to mssql server.

    When i wrote sample script like that:

    PHP Code:
    <?php 

    mssql_connect
    ("localhost""id""pw") or die('error');

    ?>
    Then i get next error:


    Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: localhost in C:\www\reg\test.php on line 3
    Could not select the database1

    I tried almost evrything ... creater a lot logins allowed remote connections but nothinh help. Btw php is running on the same server as mssql 2005.

    Thanks for help.


  2. #2
    http://kalserverace.com Ace-SG1- is offline
    MemberRank
    Sep 2006 Join Date
    HawaiiLocation
    1,711Posts

    Re: php - mssql 2005

    try take out "or die('error')"

  3. #3
    Account Upgraded | Title Enabled! joze is offline
    MemberRank
    Sep 2006 Join Date
    213213Location
    407Posts

    Re: php - mssql 2005

    then i get just:

    Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: localhost in C:\www\reg\test.php on line 3

  4. #4
    Account Upgraded | Title Enabled! joze is offline
    MemberRank
    Sep 2006 Join Date
    213213Location
    407Posts

    Re: php - mssql 2005

    Nobody know what else can be wrong?

  5. #5
    Enthusiast KoD is offline
    MemberRank
    Apr 2007 Join Date
    33Posts

    Re: php - mssql 2005

    here also guys

  6. #6
    Account Upgraded | Title Enabled! Bloodfreak913 is offline
    MemberRank
    Sep 2006 Join Date
    GermanyLocation
    511Posts

    Re: php - mssql 2005

    if (ALLOW_OPEN != 1){
    exit("<strong>Error: </strong>Leave NuB ;]");
    }
    $connect = mssql_connect("localhost","ID","PW");

  7. #7
    Member killeraxe13 is offline
    MemberRank
    Aug 2007 Join Date
    Behind my ComputerLocation
    92Posts

    Re: php - mssql 2005

    try this with selecting database because you said it gives error "Could not select the database1", either connect to kal_auth or kal_db.

    PHP Code:
    $msconnect mssql_connect("localhost""user""pass");
    $msdb mssql_select_db("kal_auth"$msconnect); 
    If this doesnt work you can try to connect without user/pass;

    PHP Code:
    $msconnect mssql_connect("localhost"); 
    $msdb mssql_select_db("kal_auth"$msconnect); 

  8. #8
    Enthusiast KoD is offline
    MemberRank
    Apr 2007 Join Date
    33Posts

    Re: php - mssql 2005

    still not workin



Advertisement