$sql=sprintf("INSERT INTO film( $id, $tittle, $duration, $language)
VALUES('%d','%s','%d','%s')",
$id,$tittle,$duration,$language);
return$sql;
}
//Returns a query to get the film's data.
publicfunctionFilmData($id){
$sql=sprintf("SELECT * FROM film WHERE id = '%d'",$id);
$resul=mysqli_query($this->mysqli,$sql)ordie('Error into query database');
return$resul;
}
//Returns a query to get All the films.
publicfunctionallFilmData(){
$sql=sprintf("SELECT * FROM film ");
$resul=mysqli_query($this->mysqli,$sql)ordie('Error into query database');
return$resul;
}
//Returns a query to get all films tittles.
publicfunctiontittleFilmData(){
$sql=sprintf("SELECT DISTINCT tittle FROM film ");
$resul=mysqli_query($this->mysqli,$sql)ordie('Error into query database');
return$resul;
}
//Returns a query to get all films descriptions.
publicfunctiondescriptionFilmData(){
$sql=sprintf("SELECT description FROM film ");
$resul=mysqli_query($this->mysqli,$sql)ordie('Error into query database');
return$resul;
}
/*
publicfunctionaddFilm($films){
$resul=mysqli_query($this->mysqli,$this->createFilm($film.getId(),$film.getTittle(),$film.getDuration(),$film.getLanguage(),$film.getDescription()))ordie('Error into query database');
return$resul;
}
*/
//Deleted film by "id".
publicfunctiondeleteFilm($id){
$sql=sprintf("DELETE FROM film WHERE film.id = '%d' ;",$id);
$resul=mysqli_query($this->mysqli,$sql)ordie('Error into query database');