IIRC related parameters should be parameters, not procedure names. Can you give this test by replacing the first ? in the name of the stored procedure?
$stmt = $pdo->prepare('EXEC your-proc-name = GetMyCities_sp @StateID = ?, @TestData = ?'); $stmt->bindParam(1, $stateId, \PDO::PARAM_INT); $stmt->bindParam(2, $testData, \PDO::PARAM_INT | \PDO::PARAM_INPUT_OUTPUT, 20);
It has been a long time since I played with PHP, but you can do this if the first test works:
$stmt = $pdo->prepare('EXEC $retVal = GetMyCities_sp @StateID = ?, @TestData = ?');
source share