-
-
Notifications
You must be signed in to change notification settings - Fork 42
/
db.conf.php.sample
17 lines (15 loc) · 748 Bytes
/
db.conf.php.sample
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
$dbconfig['host'] = 'localhost';
$dbconfig['user'] = 'YOURDBUSER';
$dbconfig['base'] = 'YOURDB';
$dbconfig['pass'] = 'YOURDBPASS';
$dbconfig['char'] = 'utf8';
$active_insult = 1;
$sql_insult = "SELECT * FROM insults WHERE number >= RAND() * (SELECT MAX(number) FROM insults WHERE active = :active and language = :lang ) AND language = :lang AND active = :active ORDER BY number LIMIT 1";
$update_counter = "UPDATE insults SET shown = shown + 1 WHERE number = :number";
try {
$pdo = new PDO('mysql:host=' . $dbconfig['host'] . ';dbname=' . $dbconfig['base'] . ';charset=' . $dbconfig['char'] . ';', $dbconfig['user'], $dbconfig['pass']);
} catch (PDOException $e) {
exit('Whoops. Unable to connect Database.');
}
?>