Created
August 16, 2016 07:41
-
-
Save kenial/aeca7c4fdbfca7c678b3c2b5b2b2d353 to your computer and use it in GitHub Desktop.
PDO-based stored procedure call in PHP
This file contains hidden or 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 | |
// $db = new PDO($connection_string, $db_user, $db_password); | |
$plan_code = "PLAN_CODE"; | |
$product_status = 200; | |
$page = 1; | |
$fetch = 20; | |
$qry = "CALL `db_billing`.`odp_cm_get_products`('$plan_code', $product_status, $page, $fetch, @total_row_count)"; | |
$stm = $db->prepare($qry); | |
$stm->execute(); | |
$rows = $stm->fetch(); | |
$stm->closeCursor(); | |
// fetch output params | |
$total_row_count = $db->query("select @total_row_count")->fetch(PDO::FETCH_ASSOC); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment