Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DROP PROCEDURE IF EXISTS getJobs;
- DELIMITER $$
- CREATE PROCEDURE getJobs(IN inputName VARCHAR(50))
- BEGIN
- SELECT JobNo FROM jobs WHERE PersonnelName= inputName;
- END $$
- DELIMITER ;
- <?php
- //imports the connection
- require "conn.php";
- $name = "chrisf";
- $call = mysqli_prepare($conn, 'CALL getJobs(?)');
- mysqli_stmt_bind_param($call, 's', $name);
- mysqli_stmt_execute($call);
- $result = mysqli_use_result($conn);
- //debug to check the result
- echo '<pre>'; print_r($result); echo '</pre>';
- //loop the result set and echo
- while ($row = mysqli_fetch_array($result)){
- //the command I expect to output the result
- echo "Entry" . $row[0] . "<br>";
- //debug to check the result
- echo "Entry" . $row . "<br>";
- }
- $conn->close();
- ?>
- mysqli_result Object
- (
- [current_field] => 0
- [field_count] => 1
- [lengths] =>
- [num_rows] => 0
- [type] => 1
- )
- Entry
- EntryArray
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement