Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo "<h1>Running test_procedure_1</h2>";
- echo "<pre>";
- echo "CREATE PROCEDURE `test_procedure_1`()".
- "BEGIN".
- " select 'gary';".
- " CALL raise_error;".
- "END";
- echo "</pre>";
- //connect to database
- $connection = new mysqli($db['server'], $db['user'], $db['password'], $db['name']);
- if (!($result = $connection->query("CALL test_procedure_1"))) {
- echo "CALL failed: (" . $connection->errno . ") " . $connection->error;
- }
- else{
- //loop the result set
- echo "RESULTS:";
- while ($row = $result->fetch_assoc()){
- print_r($row);
- }
- }
- echo "<br>----------<br>";
- echo "<h1>Running test_procedure_2</h2>";
- echo "<pre>";
- echo "CREATE PROCEDURE `test_procedure_2`()".
- "BEGIN".
- " CALL raise_error;".
- " select 'gary';".
- "END";
- echo "</pre>";
- $connection = new mysqli($db['server'], $db['user'], $db['password'], $db['name']);
- if (!($result2 = $connection->query("CALL test_procedure_2"))) {
- echo "CALL failed: (" . $connection->errno . ") " . $connection->error;
- }
- else{
- //loop the result set
- echo "RESULTS:";
- while ($row = $result2->fetch_assoc()){
- print_r($row);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement