I used MySQL Workbench to create a stored procedure that passes in two variable, both strings, and returns a string. I want to write code in PHP that will call the stored procedure and return the out param. I have been doing some searching online and the PHP manual and found this segment fo code.<?php /* Call a stored procedure with an INOUT parameter */ $colour = 'red'; $sth = $dbh->prepare('CALL puree_fruit(?)'); $sth->bindParam(1, $colour, PDO::PARAM_STR|PDO::PARAM_INPUT_OUTPUT, 12); $sth->execute(); print("After pureeing fruit, the colour is: $colour"); ?>
I see it has a “?” as a placeholder and does a bindParam to pass in a string and return a string. My question is how do I pass in 2 strings into a stored procedure and how do I return a string from? Do i need to use more than 1 question mark? What about the bindParam, do I need to make 2 or 3? How would I designate the bindParam for the value I want returned.
I’m sorry I am really new at this and need all the help I can get.
Thank you in advance.