Code:
- <?php
-
- require 'include/RTRStandardFunctions.php';
-
- //$vendor = strtoupper($_POST['vendor']);
- //$model = strtoupper($_POST['model']);
-
- $vendor = 'MYVENDOR';
- $model = 'MYMODEL';
-
- $db2connection = RTRdb2Connect();
- echo $db2connection;
- echo "<br>";
- // Prepare Stored Procedure call //
- $proc = 'CALL INVENTORY.SPR101R(?, ?)';
- $stmt = db2_prepare($db2connection, $proc);
- if (!$stmt) {
- echo 'Prepare failed: '.db2_stmt_error().':'.db2_stmt_errormsg();
- die("db2_prepare failed<br>");
- }
- // Define parameters //
- db2_bind_param($stmt, 1, "$vendor", DB2_PARAM_IN);
- db2_bind_param($stmt, 2, "$model", DB2_PARAM_IN);
-
- // Display results set //
- if (db2_execute($stmt)) {
- while ($row = db2_fetch_array($stmt)) {
- print " {$row[0]}, {$row[1]} <br>";
- }
- }
- else {
- echo 'Execute failed: '.db2_stmt_error().':'.db2_stmt_errormsg();
- die("db2_execute failed<br>");
- }
-
- ?>
-
-
|
|