#35920 [NEW]: mssql_bind(): Unable to set parameter

From: Date: Fri, 06 Jan 2006 15:19:07 +0000
Subject: #35920 [NEW]: mssql_bind(): Unable to set parameter
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-91629@lists.php.net to get a copy of this message
From:             eaboyle at gemstonewd dot com
Operating system: window XP pro
PHP version:      4.4.1
PHP Bug Type:     MSSQL related
Bug description:  mssql_bind(): Unable to set parameter 

Description:
------------
I'm trying to get output from an mssql stored procedure.

I get "mssql_bind(): Unable to set parameter warning on line  6. 

I have "allow_call_time_pass_reference = On" in my php.ini.



Reproduce code:
---------------
1 $db = new clsDBsqlRags();
2 $db->connect();
3 $stmt=mssql_init("sp_NEXT_ACT_NUM ",$db->Link_ID); 
4 $act_base = 1;
5 mssql_bind($stmt,"@ACT_BASE", $act_base, SQLINT4);
6 mssql_bind($stmt, "RTNVAL", &$act_num, SQLINT4);
7
8 $result=mssql_execute($stmt, FALSE);

Stored procedure:



CREATE PROCEDURE sp_NEXT_ACT_NUM     
  @ACT_BASE int
AS

  DECLARE 
    @Act int                 --FETCHED CLIENT.ACCOUNT VALUE

  --GET SET OF ACCOUTS FROM CLIENT TABLE
  DECLARE Crsr_Act CURSOR
  FOR 
    SELECT C.ACCOUNT
    FROM CLIENT C
    WHERE C.ACCOUNT >= @ACT_BASE
    ORDER BY ACCOUNT

  OPEN Crsr_Act

  FETCH Crsr_Act INTO @Act

  --TRAVERSE Crsr_Act
  WHILE (@@FETCH_STATUS = 0)
  BEGIN

    IF @ACT_BASE < @Act 
      BREAK
    ELSE IF @ACT_BASE = @Act
      SELECT @ACT_BASE = @ACT_BASE + 1

    FETCH Crsr_Act INTO @Act

  END

  CLOSE Crsr_Act
  DEALLOCATE Crsr_Act

  RETURN @ACT_BASE


GO


Expected result:
----------------
expect $act_num to be set to the return value of the mssql stored
procedure.

Actual result:
--------------
mssql_bind(): Unable to set parameter warning on line  6. 

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


Thread (6 messages)

« previous php.bugs (#91629) next »