Changeset 1918
- Timestamp:
- 4/16/2010 7:01:44 AM (3 years ago)
- Location:
- trunk/website/scripts
- Files:
-
- 1 edited
- 1 moved
-
. (modified) (1 prop)
-
Database.php (moved) (moved from trunk/website/scripts/Database.php.in) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/website/scripts
- Property svn:ignore
-
old new 1 1 _notes 2 database.php3 2 error.log 3 Credentials.php
-
- Property svn:ignore
-
trunk/website/scripts/Database.php
r1911 r1918 7 7 */ 8 8 9 require_once('Credentials.php'); 10 11 mysql_connect('localhost', $GLOBALS['database_username'], $GLOBALS['database_password']) or die(mysql_error()); 12 mysql_select_db('eraser') or die(mysql_error()); 13 14 function PhpToMySqlTimestamp($timestamp) 15 { 16 return date('Y-m-d H:i:s', $timestamp); 17 } 18 19 function MySqlToPhpTimestamp($timestamp) 20 { 21 return strtotime($timestamp); 22 } 23 9 24 /** 10 25 * PDO-derived database class which handles database connections. … … 14 29 public function __construct() 15 30 { 16 parent::__construct( $dsn, $username, $passwd, $options);31 parent::__construct('mysql:host=localhost;dbname=eraser', $GLOBALS['database_username'], $GLOBALS['database_password']); 17 32 $this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 18 33 }
Note: See TracChangeset
for help on using the changeset viewer.
