diff --git a/db.php b/db.php index b0d1a70..dd46e07 100644 --- a/db.php +++ b/db.php @@ -3,7 +3,7 @@ function fetchCats() { $server = 'mysql'; $username = 'student'; $password = 'student'; - $schema = 'ibuy'; + $schema = 'assignment1'; $pdo = new PDO('mysql:dbname=' . $schema . ';host=' . $server, $username, $password); $stmt = $pdo->prepare('SELECT * FROM category'); $stmt->execute(); diff --git a/public/account/login.php b/public/account/login.php index 8e4843f..548129b 100644 --- a/public/account/login.php +++ b/public/account/login.php @@ -13,7 +13,7 @@ require '../../layout.php'; $server = 'mysql'; $username = 'student'; $password = 'student'; -$schema = 'ibuy'; +$schema = 'assignment1'; $pdo = new PDO('mysql:dbname=' . $schema . ';host=' . $server, $username, $password); if (isset($_POST['submit'])) { $stmt = $pdo->prepare('SELECT * FROM users WHERE email = :email'); diff --git a/public/account/register.php b/public/account/register.php index 8efff36..b9d8564 100644 --- a/public/account/register.php +++ b/public/account/register.php @@ -3,7 +3,7 @@ function addUser() { $server = 'mysql'; $username = 'student'; $password = 'student'; - $schema = 'ibuy'; + $schema = 'assignment1'; $pdo = new PDO('mysql:dbname=' . $schema . ';host=' . $server, $username, $password); $stmt = $pdo->prepare('INSERT INTO users (first_name, last_name, email, password, admin) diff --git a/public/index.php b/public/index.php index c374082..8655677 100644 --- a/public/index.php +++ b/public/index.php @@ -21,7 +21,7 @@ function populateList($category) { //TODO: This will need to be updated to popul $server = 'mysql'; $username = 'student'; $password = 'student'; - $schema = 'ibuy'; + $schema = 'assignment1'; $pdo = new PDO('mysql:dbname=' . $schema . ';host=' . $server, $username, $password); if ($category === 'Latest Listings') { @@ -48,7 +48,7 @@ function populateList($category) { //TODO: This will need to be updated to popul $output .= '
  • product name
    -

    '. $listing['name'] .'

    +

    '. $listing['title'] .'

    '. $listing['categoryId'] .'

    '. $listing['description'] .'

    Current bid:'. $stmt->fetch()['MAX(amount)'] .'

    diff --git a/public/listing.php b/public/listing.php index 5768a09..974db00 100644 --- a/public/listing.php +++ b/public/listing.php @@ -11,7 +11,7 @@ function populateContent() { $server = 'mysql'; $username = 'student'; $password = 'student'; - $schema = 'ibuy'; + $schema = 'assignment1'; $pdo = new PDO('mysql:dbname=' . $schema . ';host=' . $server, $username, $password); $stmt = $pdo->prepare('SELECT * FROM auction WHERE listing_id= :listing_id'); @@ -44,7 +44,7 @@ function populateContent() { $output = ' product name
    -

    '. $listing['name'] .'

    +

    '. $listing['title'] .'

    '. $category['name'] .'

    Auction created by '. $user['first_name'].$user['last_name'] .'

    Current bid: '. $bid['MAX(amount)'] .'