Created
November 26, 2020 14:21
-
-
Save nikic/2d93c399d25921bd21c6e7920c4976de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$pdo = new PDO('mysql:unix_socket=/var/run/mysqld/mysqld.sock;dbname=test', 'root', ''); | |
$pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); | |
/* | |
$pdo->exec(' | |
CREATE PROCEDURE out_bug(OUT param INT UNSIGNED) | |
BEGIN | |
SET param := 3; | |
END; | |
'); | |
*/ | |
$out = 0; | |
$s = $pdo->prepare('CALL out_bug(:out)'); | |
$s->bindParam('out', $out, PDO::PARAM_INT, 0); | |
$s->execute(); | |
echo 'out is: ' . $out . "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment