Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getPhones($id) {
- $data = Array();
- if ($stmt = $this->connection->prepare("select * from phones where PersonID = ?")) {
- $stmt->bind_param("i", intval($id));
- $stmt->execute();
- $stmt->store_result(); //returns the entire result set to the client immediately. If your result set is really large, this could be a problem.
- $stmt->bind_result($id, $type, $pNum, $areaCode);
- //fetch the rows
- if ($stmt->num_rows > 0) {
- while ($stmt->fetch()) {
- $data[] = array('id' => $id,
- 'first' => $type,
- 'last' => $pNum,
- 'nick' => $areaCode);
- }
- }
- }
- return $data;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement