From 9e9661e4f986481588dc0fe377628c0fa80b70a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mu=C3=B1oz=20Garcia?= <73303506+danimu03@users.noreply.github.com> Date: Tue, 13 Apr 2021 15:45:57 +0200 Subject: [PATCH] update function tittleFilmData() added DISTINCT clause to avoid duplicates in the query --- panel_admin/includes/film_dao.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/panel_admin/includes/film_dao.php b/panel_admin/includes/film_dao.php index a342a1e..e9be226 100644 --- a/panel_admin/includes/film_dao.php +++ b/panel_admin/includes/film_dao.php @@ -65,14 +65,13 @@ $tittle,$duration,$language, $description,$id); $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); - return $resul; } //Returns a query to get all films tittles. public function tittleFilmData(){ - $sql = sprintf( "SELECT tittle FROM film "); + $sql = sprintf( "SELECT DISTINCT tittle FROM film "); $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); return $resul;