-
Notifications
You must be signed in to change notification settings - Fork 580
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
357e40c
commit 2b59e17
Showing
7 changed files
with
97 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,36 @@ | ||
<?php | ||
|
||
const DB_MYSQL = 0; | ||
const DB_POSTGRESQL = 1; | ||
const DB_SQLITE3 = 2; | ||
|
||
// ======== Start of user-configurable variables ======================= | ||
// --- set this to use YOUR database type: ------ | ||
$dbType = DB_SQLITE3; | ||
|
||
// if your database is DB_SQLITE3, you need to set the path to your database file: | ||
$pathToSQLite = 'sqlite\gpstracker.sqlite'; | ||
|
||
// ======== End of user-configurable variables ======================= | ||
|
||
$dbuser = 'gpstracker_user'; | ||
$dbpass = 'gpstracker'; | ||
|
||
$params = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, | ||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC); | ||
|
||
$pdo = new PDO('mysql:host=localhost;dbname=gpstracker;charset=utf8', $dbuser, $dbpass, $params); | ||
|
||
switch ($dbType) { | ||
case DB_MYSQL: | ||
$pdo = new PDO('mysql:host=localhost;dbname=gpstracker;charset=utf8', $dbuser, $dbpass, $params); | ||
$sqlFunctionCallMethod = 'CALL '; | ||
break; | ||
case DB_POSTGRESQL: | ||
$pdo = new PDO('pgsql:host=localhost;dbname=gpstracker', $dbuser, $dbpass, $params); | ||
$sqlFunctionCallMethod = 'select '; | ||
break; | ||
case DB_SQLITE3: | ||
$pdo = new PDO('sqlite:'.$pathToSQLite, $dbuser, $dbpass, $params); | ||
$sqlFunctionCallMethod = 'select '; | ||
break; | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters