tell me the best way to invoke spprepexecrpc in sql server?

I figured it out, one way of solving this is executing your StoredProcedure through PHP connector to ODBC using PDO

$odbcDataSource = 'dataSource';
$user = 'userName';
$password = 'userPassword';

$call = "{CALL OdbcOneParameterProcedure( ? )}";

$connection = new PDO($odbcDataSource, $user, $password);
if (!$connection) {
    echo 'Connection failed' . odbc_errormsg();
} else {
    echo 'Connected';

    $param = 0;

    $statement = $connection->prepare($call);
    $statement->bindParam(1, $param, PDO::PARAM_INT);

    // dump result to quickly verify correctness of query
    $result = $statement->fetchAll();

$connection = null;

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top