Home > Backend Development > PHP Tutorial > mysql - 如何使用php调用sql server的存储过程?

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:36:22
Original
1229 people have browsed it

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

回复内容:

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

<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");
?>
</code>
Copy after login

PHPNET

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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template