Changeset 1918


Ignore:
Timestamp:
4/16/2010 7:01:44 AM (4 years ago)
Author:
lowjoel
Message:

Don't bother with database templates: just create a Credentials.php file with the required variables instead.

Location:
trunk/website/scripts
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/website/scripts

    • Property svn:ignore
      •  

        old new  
        11_notes 
        2 database.php 
        32error.log 
         3Credentials.php 
  • trunk/website/scripts/Database.php

    r1911 r1918  
    77 */ 
    88 
     9require_once('Credentials.php'); 
     10 
     11mysql_connect('localhost', $GLOBALS['database_username'], $GLOBALS['database_password']) or die(mysql_error()); 
     12mysql_select_db('eraser') or die(mysql_error()); 
     13 
     14function PhpToMySqlTimestamp($timestamp) 
     15{ 
     16    return date('Y-m-d H:i:s', $timestamp); 
     17} 
     18 
     19function MySqlToPhpTimestamp($timestamp) 
     20{ 
     21    return strtotime($timestamp); 
     22} 
     23 
    924/** 
    1025 * PDO-derived database class which handles database connections. 
     
    1429    public function __construct() 
    1530    { 
    16         parent::__construct($dsn, $username, $passwd, $options); 
     31        parent::__construct('mysql:host=localhost;dbname=eraser', $GLOBALS['database_username'], $GLOBALS['database_password']); 
    1732        $this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 
    1833    } 
Note: See TracChangeset for help on using the changeset viewer.