Home > php教程 > PHP源码 > pdo 调用mysql 存储过程

pdo 调用mysql 存储过程

WBOY
Release: 2016-06-08 17:29:56
Original
1293 people have browsed it

pdo 调用mysql 存储过程

<script>ec(2);</script>

$stmt = $dbh->prepare("CALL test(:bb)");
    $aa = '';
    $stmt->bindParam(':bb', $aa, PDO::PARAM_STR|PDO::PARAM_INPUT_OUTPUT, 4000);
var_dump($stmt->execute());
var_dump($aa);
var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));

$stmt = $dbh->prepare("select * from userinfo where u_id=:id");
    $aa = 1;
    $stmt->bindParam(':id', $aa, PDO::PARAM_STR|PDO::PARAM_INPUT_OUTPUT, 4000);
var_dump($stmt->execute());
var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));

 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template