ID:               37708
 User updated by:  frank dot neitzel at volkswagen dot de
 Reported By:      frank dot neitzel at volkswagen dot de
-Status:           Open
+Status:           Closed
 Bug Type:         MSSQL related
 Operating System: Windows 2003
 PHP Version:      5.1.4
 New Comment:

Usererror:

Mistake is here: mssql_fetch_array($rst, $con4);

... no ConnectionId ... *uuh, oh*

regards,
Frank Neitzel


Previous Comments:
------------------------------------------------------------------------

[2006-06-06 07:24:18] frank dot neitzel at volkswagen dot de

Description:
------------
If I have to include a file per "require_once", the mssql-functions
will get an own life.

-- Life 1 --
#require_once("xxx.php");
$con4 = mssql_connect (....);
mssql_select_db (..., $con4);
...
->
    [Field1] => ...
    [Field2] => ...

-- Life 2 --
require_once("xxx.php");
$con4 = mssql_connect (....);
mssql_select_db (..., $con4);
...
->
    [1] => ...
    [2] => ...

-- so should it be and will work --
mssql_connect (....);
mssql_select_db (...);
...
->

    [1] => ...
    [Field1] => ...
    [2] => ...
    [Field2] => ...


Reproduce code:
---------------
<pre><?

#require_once("xxx.php");


 // named db-connection
 $con4 = mssql_connect ("db-intranet.han.vw.vwg", "xxx", "xxx");
 mssql_select_db ("VWN_Redax", $con4);
 $rst = mssql_query("exec vwn_redax.dbo.sp_get_groups_to_user
@u_authuser = 'devwag00\\eneitze'", $con4);
 $tblUsers = mssql_fetch_array($rst, $con4);
 print_r($tblUsers);

 // unnamed db-connection
 mssql_connect ("db-intranet.han.vw.vwg", "xxx", "xxx");
 mssql_select_db ("VWN_Redax");
 $rst = mssql_query("exec vwn_redax.dbo.sp_get_groups_to_user
@u_authuser = 'devwag00\\eneitze'");
 $tblUsers = mssql_fetch_array($rst);
 print_r($tblUsers);


?></pre>

Expected result:
----------------
    [0] => 1
    [tblRolesId] => 1
    [1] => Mitglied
    [tblRolesTitle] => Mitglied
    [2] => 3105
    [tblGroupsId] => 3105
    [3] => 2-C-1 FiSi Admin
    [tblGroupsTitle] => 2-C-1 FiSi Admin


Actual result:
--------------
    [0] => 1
    [1] => Mitglied
    [2] => 3105
    [3] => 2-C-1 FiSi Admin

or

    [tblRolesId] => 1
    [tblRolesTitle] => Mitglied
    [tblGroupsId] => 3105

... depends on including a file or not.


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


-- 
Edit this bug report at http://bugs.php.net/?id=37708&edit=1

Reply via email to