Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class dbconnect{
- public function connect(){
- $host = 'localhost';
- $user = 'root';
- $pass = '';
- $db = 'demo';
- $connection = mysqli_connect($host,$user,$pass,$db);
- return $connection;
- }
- }
- include 'dbconnect.php';
- class dao extends dbconnect{
- private $conn;
- function __dao(){
- $dbcon = new dbconnect();
- $conn = $dbcon->connect();
- }
- function select( $table , $where='' , $other='' ){
- if(!$where = '' ){
- $where = 'where' . $where;
- }
- $sele = mysqli_query($this->conn,"SELECT * FROM $table $where $other") or die(mysqli_error($this->conn));
- echo $sele;
- return $sele;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement