Advertisement
Guest User

Untitled

a guest
Apr 9th, 2020
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.55 KB | None | 0 0
  1.     public function join_select($params, $secondary_table, $join_cond) {
  2.         $query = 'SELECT ';
  3.  
  4.         foreach($params as $val) {
  5.             $query = $query . '`' . $val . '`, ';
  6.         }
  7.         $query = rtrim($query, ',');
  8.        
  9.         $query = $query . ' FROM `' . $this->table . '` JOIN `' . $secondary_table . '` ON `' . $this->table . '.' . $join_cond . '` = `' . $secondary_table . '.' . $join_cond . '`';
  10.  
  11.         $query = $this->prep_exec($query, $params);
  12.         $array = $this->fetchAsArray($query);
  13.  
  14.         return $array;
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement