Note that there are some explanatory texts on larger screens.

plurals
  1. POCould you please assist me with PHP 5.3 and MySQL 5.5 stored procedures and mysqli library + persistent connection
    primarykey
    data
    text
    <p>Helo,</p> <p>I have a stored procedure that has 7 IN parameters and 3 OUT parameters. I need to pass 7 parameters IN from PHP, execute the query with procedure, and retrieve the 3 OUT parameters.</p> <p>I am using mysqli with persistent connection mode enabled. (For load considerations) What is the most efficient way to execute the query and get results?</p> <p>I need something that doesn't affect other concurrently running PHP scripts, and that cleans the result itself, and that is straightforward. </p> <p>This is what my application is (simplified) (not a working example, just how i wish it was)</p> <pre><code>$inParam1 = 'wer'; $inParam2 = 'fewf'; $inParam3 = 'dsf'; $inParam4 = 'vccv'; $inParam5 = '34t3'; $inParam6 = 'ter'; $inParam7 = 'ert'; $query = "CALL my_procedure('$inParam1', '$inParam2', '$inParam3', '$inParam4', '$inParam5', '$inParam6', '$inParam7', @outParam8, @outParam9, @outParam10); SELECT @outParam8, @outParam9, @outParam10;"; $result = $mysql_query($query); list($outParam1, $outParam2, $outParam3) = mysql_fetch_array($result); echo $outParam1; // String param #1 that my procedure returned as an OUT variable echo $outParam2; // String param #2 that my procedure returned as an OUT variable echo $outParam3; // String param #3 that my procedure returned as an OUT variable </code></pre> <p>If somebody could show how this code could look in reality, please please would be great!</p> <p>I am obviously using mysqli with proper connection, and such, but the examples I have found in internet are really confusing and seem to be inefficient, I am also worried if it will conflict with other clients, because it works like "nextResult" and other some strange functions.</p> <p>Many thanks!</p> <p>PHP 5.3, MySQL 5.5</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload