Jump to content

michaelmuller

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Posts posted by michaelmuller

  1. I'm not getting any errors at all, until I actually run a query.  I have tested the query by copying it into a new query window in SQL Server Manager, and it works. Yet, through the PHP connection I get a fail, and no explanation.

     

    I'm going to have to take a break from this, or I'm going to shoot someone.

  2. I have now added the code you mention (just found it myself and was going to report update here and saw you thought of the same thing -- cool);

     

    I also added the two lines you suggested to my php.ini file (and restarted the service).  Still getting nothing. And mssql_get_last_message(); is blank.

     

    I guess my connect string is incorrect somehow. DA114 is my machine name.

     

    <?php

    $db = "[db_name]";

    $link = mssql_connect("DA114\SQLEXPRESS","[username]","[password]") ;

    echo "<p>yo 1</p>";

    echo mssql_get_last_message();

    echo "<p>yo 2</p>";

    ?>

     

  3. Update:

     

    I realized after the fact that I hadn't added any MSSQL.* settings to php.ini.  Now that I have, I am getting the "die" code to display, ie; "Could not connect: "

     

    I'm doing my best to RTFM but am only very slowly getting ahead. Any assistance would be greatly appreciated.

     

    This is how I have the PHP code now:

     

    <?php

    $db = "[dbname]";

    $link = mssql_connect("localhost\SQLEXPRESS","[username]","[password]") or die("Could not connect: ");

    ?>

     

    ------------------------------

     

    [MSSQL]

    mssql.allow_persistent = 1

    mssql.max_persistent = -1

    mssql.max_links = -1

    mssql.min_error_severity = 10

    mssql.min_message_severity = 10

    mssql.compatability_mode = 0

    mssql.connect_timeout = 5

    mssql.timeout = 60

    mssql.textsize = -1

    mssql.textlimit = -1

    mssql.batchsize  = 0

    mssql.datetimeconvert = 1

    mssql.secure_connection = 0

    mssql.max_procs = -1

    mssql.charset = UTF-8

     

  4. I'm new to PHP and just copied some code from a LAMP box to my Windows server. I ported the mySql database to MS Sql and modified all the PHP code to use MSSQL_* instead of MYSQL_* and made sure that php.ini properly loads c:\php\ext\php_mssql.dll

     

    When the following code runs, it just fails, silently. I only see "Config Start" in the output. Nothing after it.

     

    Any advice?

     

    Mik

     

    ------------------

     

    <p>Config Start</p>

    <?php

    $db = "mydbname";

    $link = mssql_connect("localhost","username","userpw") or die("Could not connect: ");

    ?>

    <p>Config End</p>

  5. I was having the same problem. Rather than force Windows to load php.ini from the c:\php folder I just copied it to the c:\windows folder (as it apparently wanted to) and all was right with the world.

     

    BTW, if you're seeing TWO copies of php.ini in the same folder, then something is dramatically wrong, because no OS that I know of will allow two files with the same filename to exist in the same folder.  My guess is you have Windows "hiding known file extensions" and you're really looking at php.ini.txt and php.ini.???

     

    When in Explorer. you should go to Tools > Folder Options > View... and UNCHECK "Hide extensions..."

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.