Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function category_search($category) {
- $this -> db -> select('a.id, a.artist_fname, a.artist_lname, b.artist_id, b.sm_file_name, b.category_id, b.category_id2, b.category_id3, c.id, c.category');
- $this -> db -> from('ap_mini_artist a', 'ap_mini_artwork b', 'ap_art_categories c', 'ap_art_categories c2', 'ap_art_categories c3');
- $this -> db -> where('c.category', $category, 'after');
- $this -> db -> join('ap_mini_artwork b', 'b.artist_id=a.id', 'left');
- $this -> db -> join('ap_art_categories c', 'c.id=b.category_id', 'left');
- $this -> db -> join('ap_art_categories c2', 'c2.id=b.category_id2', 'left');
- $this -> db -> join('ap_art_categories c3', 'c3.id=b.category_id3', 'left');
- $query = $this -> db -> get();
- return $query -> result();
- }
- public function category_search() {
- $category = $this -> input -> post('categoryValue');
- $query = $this -> mini_show_model -> category_search($category);
- if (!empty($query)) {
- $json = json_encode($query);
- print $json;
- } else {
- echo "Your query is empty, please try again.";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement