From 96e8937f89e158e49866257c1df10022a6c7544d Mon Sep 17 00:00:00 2001
From: William Vonderscher <william.vonderscher2@etu.univ-lorraine.fr>
Date: Wed, 11 Mar 2020 11:38:03 +0100
Subject: [PATCH] permiere question des indexes

---
 GamePedia/php/script_TD3a.php                  | 5 +++++
 GamePedia/src/controleurs/ControleurScript.php | 8 ++++++++
 2 files changed, 13 insertions(+)

diff --git a/GamePedia/php/script_TD3a.php b/GamePedia/php/script_TD3a.php
index 45769af..959bac4 100644
--- a/GamePedia/php/script_TD3a.php
+++ b/GamePedia/php/script_TD3a.php
@@ -45,4 +45,9 @@ echo 'Cache de requete mysql, tous les jeux: ';
 echo $c->allGame();
 echo 'µs .<br>';
 
+echo'index : <br>';
+
+echo 'jeux qui commencent par Ma :'.$c->td3_index('Ma').'<br>';
+echo 'jeux qui commencent par Ac :'.$c->td3_index('Ac').'<br>';
+echo 'jeux qui commencent par Pr :'.$c->td3_index('Pr');
 echo ("</body> </html>");
\ No newline at end of file
diff --git a/GamePedia/src/controleurs/ControleurScript.php b/GamePedia/src/controleurs/ControleurScript.php
index bdf532e..767ffe1 100644
--- a/GamePedia/src/controleurs/ControleurScript.php
+++ b/GamePedia/src/controleurs/ControleurScript.php
@@ -279,6 +279,14 @@ class ControleurScript
         return Company::where('name','like', '%Sony%')->get()->games();
     }
 
+    public function td3_index($val){
+        $time_start = microtime(true);
+        Game::where('name', 'like', $val.'%')->get();
+        $time_end = microtime(true);
+        $time = $time_end - $time_start;
+        return $time;
+    }
+
     public function allGame(){
         $time_start = microtime(true);
         Game::get();
-- 
GitLab