Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. <?php
  2.  
  3. class Table {
  4. private $db;
  5. public function __constructor()
  6. {
  7. $this->db = new mysqli();
  8. }
  9.  
  10. public function getRowsFromDb($id=0)
  11. {
  12. $res = $this->db->query("SELECT * FROM sdfsdf");
  13. $arr = array();
  14. if ($res->num_rows > 0) {
  15. while($row = $res->fetch_assoc()) {
  16. $arr[] = $row;
  17. }
  18. }
  19. return $arr;
  20. }
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement