nitinegoro

Untitled

Dec 28th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * Jquery Nestable List
  5.  * @author Vicky Nitinegoro
  6.  * @see http://vicky-nitinegoro.blogspot.co.id/2016/12/membuat-menggunakan-jquery-nestable.html
  7.  **/
  8.  
  9. class Menu
  10. {
  11.     public $connection;
  12.  
  13.     /* Pengaturan Database */
  14.     // host name
  15.     private $hostname = 'localhost';
  16.     // password
  17.     private $user = 'root';
  18.     // password
  19.     private $password = '';
  20.     // database name
  21.     private $database = 'test';
  22.  
  23.     public function __construct()
  24.     {
  25.         $this->connection = mysqli_connect($this->hostname, $this->user, $this->password, $this->database);
  26.         return $this->connection;
  27.     }
  28.  
  29.     public function getMenu()
  30.     {
  31.         $query = mysqli_query($this->connection, "SELECT * FROM tabel_menu WHERE menu_parent IN('0')");
  32.         return $query;
  33.     }
  34. }
Add Comment
Please, Sign In to add comment