SHARE
TWEET

Untitled

a guest Aug 20th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top