Beispiel #1
0
 function __construct($id = -1)
 {
     if (self::$conn == Null) {
         self::$conn = mysqli_connect('localhost', 'root', 'iti', 'GEO');
     }
     if ($id != -1) {
         $query = "select * from sub_cato where id_cato={$id_cato} and id_sub={$id_sub} limit 1";
         $result = mysqli_query(self::$conn, $query);
         $prod = mysqli_fetch_assoc($result);
         $this->id_cato = $prod['id_cato'];
         $this->id_sub = $prod['id_sub'];
         $this->name_sub = $prod['name_sub'];
     }
 }