SHARE
TWEET

Read from BD

brainode Feb 10th, 2014 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /**
  3.  * Created by PhpStorm.
  4.  * User: asus
  5.  * Date: 2/10/14
  6.  * Time: 4:51 PM
  7.  */
  8.  
  9. //namespace core;
  10.  
  11.  
  12. abstract class read extends connect{
  13.     public static function select($bdName,$tableName,$select,$where){
  14.         $connection=connect::connect();
  15.         if(isset($where)&&$where!=false){
  16.             $whereFlag=true;
  17.         }else{
  18.             $whereFlag=false;
  19.         }
  20.         switch($whereFlag):
  21.             case false:
  22.                 $query="SELECT ".$select." FROM ".$bdName.".".$tableName;
  23.                 break;
  24.             case true:
  25.                 $query="SELECT ".$select." FROM ".$bdName.".".$tableName." WHERE ".$where;
  26.                 break;
  27.         endswitch;
  28.         $result=mysqli_query($connection,$query);
  29.         return $result;
  30.     }
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top