Skip to content
Permalink
e7bebbb684
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
25 lines (18 sloc) 695 Bytes
<?php
function getDatabase() {
// tells php that the database lives on the same server as the php file
//$dbhost = "localhost";
$dbhost = "develop.digitalmediauconn.org";
// this is the username
$dbuser = "phonebk";
// this is the password
$dbpass = "phonebk";
// name of the DB that we set up together
$dbname = "phonebk";
// this just makes a little config line for PHP to read
$mysql_conn_string = "mysql:host=$dbhost;dbname=$dbname";
//setup a new connection using the stuff up above
$database = new PDO($mysql_conn_string, $dbuser, $dbpass);
$database->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
return $database;
}