Advertisement
Guest User

Untitled

a guest
May 3rd, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. class dbconnect{
  2. public function connect(){
  3. $host = 'localhost';
  4. $user = 'root';
  5. $pass = '';
  6. $db = 'demo';
  7. $connection = mysqli_connect($host,$user,$pass,$db);
  8. return $connection;
  9. }
  10. }
  11.  
  12. include 'dbconnect.php';
  13. class dao extends dbconnect{
  14. private $conn;
  15. function __dao(){
  16. $dbcon = new dbconnect();
  17. $conn = $dbcon->connect();
  18. }
  19. function select( $table , $where='' , $other='' ){
  20. if(!$where = '' ){
  21. $where = 'where' . $where;
  22. }
  23. $sele = mysqli_query($this->conn,"SELECT * FROM $table $where $other") or die(mysqli_error($this->conn));
  24. echo $sele;
  25. return $sele;
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement