Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. function getPhones($id) {
  2. $data = Array();
  3. if ($stmt = $this->connection->prepare("select * from phones where PersonID = ?")) {
  4. $stmt->bind_param("i", intval($id));
  5. $stmt->execute();
  6. $stmt->store_result(); //returns the entire result set to the client immediately. If your result set is really large, this could be a problem.
  7. $stmt->bind_result($id, $type, $pNum, $areaCode);
  8. //fetch the rows
  9. if ($stmt->num_rows > 0) {
  10. while ($stmt->fetch()) {
  11. $data[] = array('id' => $id,
  12. 'first' => $type,
  13. 'last' => $pNum,
  14. 'nick' => $areaCode);
  15. }
  16. }
  17. }
  18. return $data;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement