<?php
class db {
public $server = 'localhost';
public $user = 'root';
public $passwd = '1234';
public $db = 'test';
public $dbCon;
function __construct(){
$this->dbCon = mysqli_connect($this->server, $this->user, $this->passwd, $this->db);
}
function __destruct(){
mysqli_close($this->dbCon);
}
function select(){
$myQuery = "SELECT * FROM type";
$results = mysqli_query($this->dbCon, $myQuery);
return $results;
}
}
?>