SAE_2.02/CodeIgniter-3.1.13/application/models/Model_artist.php
2024-05-22 20:03:53 +02:00

20 lines
537 B
PHP

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Model_artist extends CI_Model {
public function __construct(){
$this->load->database();
}
public function getArtisteById($artiste_id){
$query = $this->db->query("SELECT * FROM artist WHERE id = ?", array($artiste_id));
return $query->row();
}
public function getArtists($order = 'ASC'){
$query = $this->db->query("SELECT * FROM artist ORDER BY name " . $order);
return $query->result();
}
}
?>