From 04305d2c7947c268144e649a6dca3007051aab48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20M=C3=A9ndez?= <45081533+FerMdez@users.noreply.github.com> Date: Tue, 13 Apr 2021 17:37:15 +0200 Subject: [PATCH] Add files via upload --- panel_admin/includes/film_dao.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/panel_admin/includes/film_dao.php b/panel_admin/includes/film_dao.php index 685237d..70e24bc 100644 --- a/panel_admin/includes/film_dao.php +++ b/panel_admin/includes/film_dao.php @@ -17,6 +17,8 @@ $sql = sprintf( "INSERT INTO film( $id, $tittle, $duration, $language) VALUES ( '%d', '%s', '%d', '%s')", $id, $tittle, $duration, $language); + + $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); return $sql; } @@ -34,6 +36,10 @@ $sql = sprintf( "SELECT * FROM film "); $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); + while($fila=mysqli_fetch_array($resul)){ + $films[] = $this->loadFilm($fila["id"], $fila["tittle"], $fila["duration"], $fila["language"], $fila["description"]); + } + return $resul; } @@ -69,7 +75,7 @@ return $resul; } - + //Edit a film. public function editFilm($id, $tittle, $duration, $language,$description){ $sql = sprintf( "UPDATE film SET tittle = '%s' , duration = '%d', language ='%s' , description ='%s' WHERE film.id = '%d';",