Found a post elsewhere with a clue, the INSERT retuns an dempty rowset which must be consumed to get to the return value. This code works:
$proc = '{:retval = CALL spSMSLog (:phone, :txt, :stamp) }';
$stmt = $conn->prepare( $proc );
$stmt->bindParam(':retval',&$ReturnValue ,PDO::PARAM_INT|PDO::PARAM_INPUT_OUTPUT,4);
$stmt->bindParam(':phone',$Phone,PDO::PARAM_STR);
$stmt->bindParam(':txt',$Content,PDO::PARAM_STR);
$stmt->bindParam(':stamp',$DateTimeSent,PDO::PARAM_STR);
// Execute the procedure
try {
$stmt->execute();
}
catch (PDOException $e) {
echo 'Execute #2 failed: ' . $e->getMessage();
die( );
}
$stmt->nextRowset(); //skip INSERT result
$stmt->nextRowset();
$result = $stmt->fetch(PDO::FETCH_ASSOC);
/* Display the value of the output parameter */
echo "Return value: ".$ReturnValue.'<br>';
There was also something hinky with param length, seems you must specify length of output param and not specify length of input params. Gave up trying to get a handle on that when it started working.