I'm hoping someone has solved this issue before. I'm using an odbc_connection to an MsSQL database. It works on using stored procedures with select statements and it works on update statements as long as they do not involve any variables. But as soon as I use a variable it breaks the procedure giving me this error.

Code:
PHP Warning:  odbc_execute() [<a href='function.odbc-execute'>function.odbc-execute</a>]: SQL error: [Microsoft][ODBC SQL Server Driver]Cursor type changed, SQL state 01S02 in SQLExecute in XXXXXXXXXXX on line XX
MsSQL Code
Code:
CREATE TABLE [test] (
[id] INT NOT NULL IDENTITY PRIMARY KEY,
[name] VARCHAR(25)
)

INSERT INTO [test] 
([name])
VALUES
('Bob')

CREATE PROCEDURE [select_test]
@in_id INT
AS 
SELECT [name]
FROM [test]
WHERE [id]=@in_id

CREATE PROCEDURE [update_test_1]
AS
UPDATE [test]
SET [name]='Bill'
WHERE [id]=1

CREATE PROCEDURE [update_test_2]
@in_id INT
AS
UPDATE [test]
SET [name]='Ted'
WHERE [id]=@in_id
PHP Code:
include 'config.php';
$dbc odbc_connect(DBUSERPASSWORD);

### SELECT EXAMPLE ###
### WORKS ###

// Prep the params.
$params = array (1);
$query 'EXEC select_test @in_id=?';

// Query the db.
$ps odbc_prepare($dbc$query);
$r odbc_execute ($ps$params);

// Return the first field of the first record.
while ($row odbc_fetch_array ($ps)) {
    foreach (
$row as $ro) {
        echo 
$ro;
    }
}

### UPDATE 1 EXAMPLE ###
### WORKS ###

// Prep the params.
$params = array ();
$query 'EXEC update_test_1';

// Query the db.
$ps odbc_prepare($dbc$query);
$r odbc_execute ($ps$params);

// Return num rows affected.
echo odbc_num_rows($ps);

### UPDATE 2 EXAMPLE ###
### ERRORS OUT ###

// Prep the params.
$params = array (1);
$query 'EXEC update_test_2 @in_id=?';

// Query the db.
$ps odbc_prepare($dbc$query);
$r odbc_execute ($ps$params);

// Return num rows affected.
echo odbc_num_rows($ps);

### UPDATE 3 EXAMPLE ###
### WORKS ###

// Prep the params.
$params = array (1);
$query "UPDATE [test] SET [name]='Fred' WHERE [id]=?";

// Query the db.
$ps odbc_prepare($dbc$query);
$r odbc_execute ($ps$params);

// Return num rows affected.
echo odbc_num_rows($ps); 
Any ideas on how to get the update stored procedure with variables to work is greatly appreciated. Thanks.