From:             gyula dot fekete at different dot hu
Operating system: Linux
PHP version:      5.2.6
PHP Bug Type:     MSSQL related
Bug description:  can't read out the result from a mssql stored procedure

Description:
------------
Hello,

I connect to a MSSQL server and run a stored procedure, but I can't read
out the result of the query in that sp. I use the
mssql_init,mssql_bind,mssql_execute functions like I saw on PHP.net, but it
does not work. The stored procedure runs correctly, without any error, and
it should return values, becouse I tested it in SQL Server Man. Studio whit
the same parameters.



Reproduce code:
---------------
include("dbconn.php");

$from = 26;
$to = 28;

$dfrom = '20080101';
$dto = '20080331';

$stmt=mssql_init("FokonyvKartonLista", $conn);
mssql_bind($stmt, "@FszamTol", $from, SQLINT4);
mssql_bind($stmt, "@FszamIg", $to, SQLINT4);
mssql_bind($stmt, "@DatumTol", $dfrom, SQLCHAR);
mssql_bind($stmt, "@DatumIg", $dto, SQLCHAR);
$r=mssql_execute($stmt);


var_dump($r);
if (!$r){
    $message = "Last message from SQL : " . mssql_get_last_message() ."";
    echo $message;
}
while ($s = mssql_fetch_row($r)) {              
   echo "Row: ".$s[0]."<br />";
}

// OR
/*
do {
        while ($s = mssql_fetch_row($r)) {               
                echo "Row: ".$s[0]."<br />";
        }
}
while(mssql_next_result($r));
*/


mssql_free_result($r);

mssql_close($conn);     

Expected result:
----------------
I expect the returnd rows of the query in the stored procedure.
The result of var_dump($r) is:
        resource(5) of type (mssql result)
What does this mean?

Actual result:
--------------
No result

-- 
Edit bug report at http://bugs.php.net/?id=46609&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=46609&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=46609&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=46609&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=46609&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=46609&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=46609&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=46609&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=46609&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=46609&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=46609&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=46609&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=46609&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=46609&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=46609&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=46609&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=46609&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=46609&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=46609&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=46609&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=46609&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=46609&r=mysqlcfg

Reply via email to