Skip to content

Commit

Permalink
Mise à part des paramètres de db
Browse files Browse the repository at this point in the history
  • Loading branch information
jperon committed Nov 16, 2014
1 parent 043dc06 commit aac1d83
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
scores/
temp/
sources/
include/db.php
include/credentials.php
*~
license.txt
readme.html
Expand Down
6 changes: 6 additions & 0 deletions include/credentials.php.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
define("HOST", "localhost"); // The host you want to connect to.
define("USER", "user"); // The database username.
define("PASSWORD", "password"); // The database password.
define("DATABASE", "database"); // The database name.
?>
9 changes: 3 additions & 6 deletions include/db.php.sample → include/db.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@ function chant_from_id($c) {
$req1 = $mysqli->query($sql1) or die('Erreur SQL !<br />'.$sql1.'<br />'.$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');
Expand Down

0 comments on commit aac1d83

Please sign in to comment.