Skip to content
Permalink
develop
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
Joel Salisbury barebones phonebook
Latest commit e7bebbb Apr 5, 2017 History
0 contributors

Users who have contributed to this file

<?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;
}