From aac1d83d0870dfa7e192eeacdac822cfa0e0df76 Mon Sep 17 00:00:00 2001 From: jperon Date: Sun, 16 Nov 2014 15:41:39 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20part=20des=20param=C3=A8tres=20?= =?UTF-8?q?de=20db?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- include/credentials.php.sample | 6 ++++++ include/{db.php.sample => db.php} | 9 +++------ 3 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 include/credentials.php.sample rename include/{db.php.sample => db.php} (64%) diff --git a/.gitignore b/.gitignore index f72bdd2..255d46a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ scores/ temp/ sources/ -include/db.php +include/credentials.php *~ license.txt readme.html diff --git a/include/credentials.php.sample b/include/credentials.php.sample new file mode 100644 index 0000000..781a95f --- /dev/null +++ b/include/credentials.php.sample @@ -0,0 +1,6 @@ + diff --git a/include/db.php.sample b/include/db.php similarity index 64% rename from include/db.php.sample rename to include/db.php index e720f31..d324938 100644 --- a/include/db.php.sample +++ b/include/db.php @@ -6,14 +6,11 @@ function chant_from_id($c) { $req1 = $mysqli->query($sql1) or die('Erreur SQL !
'.$sql1.'
'.$mysqli->error); $chants = array(); $ch = $req1->fetch_assoc(); - return array($ch['office-part'], $ch['incipit'] > ''?$ch['incipit']:'░░░░', $ch['gabc'] > '', $ch['version']); + return array($ch['office-part'], $ch['incipit'], $ch['gabc'] > '', $ch['version']); } -define("HOST", ""); // The host you want to connect to. -define("USER", ""); // The database username. -define("PASSWORD", ""); // The database password. -define("DATABASE", ""); // The database name. - +include('credentials.php'); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); $mysqli->query('SET NAMES utf8');