Fix query 2/?
This commit is contained in:
		@@ -63,8 +63,12 @@ class Model_music extends CI_Model {
 | 
			
		||||
            $this->db->order_by('artist.name', $order);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $query = $this->db->get();
 | 
			
		||||
        return $query->result();
 | 
			
		||||
        if (!empty($query)) {
 | 
			
		||||
            $this->db->like('artist.name', $query);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $result = $this->db->get();
 | 
			
		||||
        return $result->result();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function getMusics($genre = '', $order = '', $artist = '') {
 | 
			
		||||
@@ -89,8 +93,12 @@ class Model_music extends CI_Model {
 | 
			
		||||
            $this->db->order_by('song.name', $order);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $query = $this->db->get();
 | 
			
		||||
        return $query->result();
 | 
			
		||||
        if (!empty($query)) {
 | 
			
		||||
            $this->db->like('song.name', $query);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $result = $this->db->get();
 | 
			
		||||
        return $result->result();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Suppression de la deuxième méthode researchtype
 | 
			
		||||
 
 | 
			
		||||
@@ -12,6 +12,7 @@
 | 
			
		||||
    <!-- Div contenant les filtres, cachée par défaut -->
 | 
			
		||||
    <div id="filters" style="display: none;">
 | 
			
		||||
        <form method="GET" action="">
 | 
			
		||||
 | 
			
		||||
            <!-- Filtre par artiste -->
 | 
			
		||||
            <label for="">Artiste : </label>
 | 
			
		||||
            <select name="artist" id="artist" onchange="this.form.submit()">
 | 
			
		||||
@@ -37,6 +38,7 @@
 | 
			
		||||
                <option value="asc" <?= isset($_GET['order']) && $_GET['order'] == 'asc' ? 'selected' : '' ?>>Croissant</option>
 | 
			
		||||
                <option value="desc" <?= isset($_GET['order']) && $_GET['order'] == 'desc' ? 'selected' : '' ?>>Décroissant</option>
 | 
			
		||||
            </select>
 | 
			
		||||
 | 
			
		||||
        </form>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user