Add functions
This commit is contained in:
parent
cf3f36c9d4
commit
4d1eb61a1e
@ -42,10 +42,13 @@
|
||||
|
||||
//Returns a film data .
|
||||
public function cinemaData($id){
|
||||
$sql = sprintf( "SELECT * FROM cinema WHERE cinema.id = '%d'", $id);
|
||||
$id = $this->mysqli->real_escape_string($id);
|
||||
|
||||
$sql = sprintf( "SELECT * FROM cinema WHERE id = '%d'", $id );
|
||||
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
||||
|
||||
$cinema = null;
|
||||
$resul->data_seek(0);
|
||||
$film = null;
|
||||
while($fila=$resul->fetch_assoc()){
|
||||
$cinema = $this->loadCinema($fila["id"], $fila["name"], $fila["direction"], $fila["phone"]);
|
||||
}
|
||||
@ -54,6 +57,14 @@
|
||||
return $cinema;
|
||||
}
|
||||
|
||||
public function existCinema($id){
|
||||
$id = $this->mysqli->real_escape_string($id);
|
||||
|
||||
$sql = sprintf( "SELECT * FROM cinema WHERE id = '%d'", $id );
|
||||
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
||||
return $resul;
|
||||
}
|
||||
|
||||
//Deleted film by "id".
|
||||
public function deleteCinema($id){
|
||||
$sql = sprintf( "DELETE FROM cinema WHERE cinema.id = '%d' ;",$id);
|
||||
|
@ -47,6 +47,14 @@
|
||||
return $film;
|
||||
}
|
||||
|
||||
public function existFilm($id){
|
||||
$id = $this->mysqli->real_escape_string($id);
|
||||
|
||||
$sql = sprintf( "SELECT * FROM film WHERE id = '%d'", $id );
|
||||
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
||||
return $resul;
|
||||
}
|
||||
|
||||
//Returns a query to get All the films.
|
||||
public function allFilmData(){
|
||||
$sql = sprintf( "SELECT * FROM film ");
|
||||
|
Loading…
Reference in New Issue
Block a user