Rumah  >  Soal Jawab  >  teks badan

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

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

迷茫迷茫2721 hari yang lalu456

membalas semua(1)saya akan balas

  • PHPz

    PHPz2017-04-10 15:31:49

    <?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

    balas
    0
  • Batalbalas