如何使用php调用sql server的存储过程?


在yii框架中用php调用sql server的存储过程,怎么操作。比如一个存储过程的方法名字为pc_sms_send,其中带有参数,如a,b,c,d.调用成功返回1,失败返回0.求示例代码

php mysql 存储过程

沉睡的饼干 9 years ago

 <?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");
?>

PHPNET

右代宮戰人 answered 9 years ago

Your Answer