Quantcast
Channel: Microsoft Drivers for PHP for SQL Server forum
Viewing all articles
Browse latest Browse all 391

How do we call sqlsrv_query(), after sqlsrv_prepare()?

$
0
0

Hi,

I'm doing an INSERT with a Stored Procedure.  Something like this:

$sql_prep = "EXEC p_1A_insert( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )";
$stmt = sqlsrv_prepare($queryLink, $sql_prep, $spParams );

, and it compiles ok.  But when I do the sqlsrv_execute(), there's an error

[Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Incorrect syntax near '@P1'.

, which makes no sense, because there is no variable @P1 in the Stored Procedure.

It looks like this is due to a bug in the driver, according to another post.  But I don't have the option of changing the driver, since I don't have access to the php server.

Since this is just a single INSERT statement (that also returns the ID of the new record), I'm trying to use sqlsrv_query().

I just don't know how to use it, in connection with the 

$stmt = sqlsrv_prepare($queryLink, $sql_prep, $spParams );

statement.

Regards,



Viewing all articles
Browse latest Browse all 391

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>