chanson d'un album

This commit is contained in:
2024-05-27 14:04:46 +02:00
parent 1e2735d5ba
commit 63937f0b53
4 changed files with 24 additions and 17 deletions

View File

@@ -28,13 +28,14 @@ class Model_music extends CI_Model {
return $query->result();
}
public function getSongOfAlbum(){
$query = $this->db->query(
"SELECT artist.id, artist.name
FROM artist
Group by artist.id
"
);
return $query->result();
public function getSongOfAlbum($album_id){
$query = $this->db->query(
"SELECT song.id, song.name
FROM song
INNER JOIN track ON song.id = track.songId
WHERE track.albumId = ?",
array($album_id)
);
return $query->result();
}
}