Professional Documents
Culture Documents
CS526 HW5 18263 Harikrishna Bandla
CS526 HW5 18263 Harikrishna Bandla
DBFiles
restaurant_db.sql
/*
Student Info: Name=Harikrishna Bandla, ID=18263
Subject: CS526B_HW5_Spring_2016
Author: Harie
Filename: restaurant_db.sql
Date and Time: Mar 20, 2016 5:31:45 PM
Project Name: Restaurant_Application_18263
*/
DROP DATABASE IF EXISTS restaurant_db;
USE restaurant_db;
CREATE TABLE categories (
categoryID
INT(11)
categoryName
INT(11)
INT(11)
foodItemName
foodItemPrice
db_connect.php
<!-Student Info: Name=Harikrishna Bandla, ID=18263
Subject: CS526B_HW5_Spring_2016
Author: Harie
Filename: db_connect.php
Date and Time: Mar 20, 2016 5:45:45 PM
Project Name: Restaurant_Application_18263
-->
<?php
$dsn = 'mysql:host=localhost;dbname=restaurant_db';
$username = 'root';
$password = '';
try {
$db = new PDO($dsn, $username, $password);
echo 'Connected.';
} catch (PDOException $ex) {
$error_msg = $ex->getMessage();
include('db_error.php');
exit();
}
?>