diff --git a/public/index.php b/public/index.php
index 88e59d8..c374082 100644
--- a/public/index.php
+++ b/public/index.php
@@ -25,12 +25,12 @@ function populateList($category) { //TODO: This will need to be updated to popul
$pdo = new PDO('mysql:dbname=' . $schema . ';host=' . $server, $username, $password);
if ($category === 'Latest Listings') {
- $stmt = $pdo->prepare('SELECT * FROM listings WHERE listing_deadline > "'. date("Y-m-d H:i:s"). '" ORDER BY listing_deadline DESC');
+ $stmt = $pdo->prepare('SELECT * FROM auction WHERE endDate > "'. date("Y-m-d H:i:s"). '" ORDER BY endDate DESC');
$stmt->execute();
$listings = $stmt->fetchAll();
}
else {
- $stmt = $pdo->prepare('SELECT * FROM listings WHERE listing_category = (SELECT category_id FROM categories WHERE category_name = :listing_category)');
+ $stmt = $pdo->prepare('SELECT * FROM auction WHERE categoryId = (SELECT category_id FROM category WHERE name = :listing_category)');
$values = [
'listing_category' => $category
];
@@ -48,9 +48,9 @@ function populateList($category) { //TODO: This will need to be updated to popul
$output .= '
-
'. $listing['listing_name'] .'
-
'. $listing['listing_category'] .'
-
'. $listing['listing_description'] .'
+
'. $listing['name'] .'
+
'. $listing['categoryId'] .'
+
'. $listing['description'] .'
Current bid:'. $stmt->fetch()['MAX(amount)'] .'
More >>
diff --git a/public/listing.php b/public/listing.php
index 72b744c..5768a09 100644
--- a/public/listing.php
+++ b/public/listing.php
@@ -14,16 +14,16 @@ function populateContent() {
$schema = 'ibuy';
$pdo = new PDO('mysql:dbname=' . $schema . ';host=' . $server, $username, $password);
- $stmt = $pdo->prepare('SELECT * FROM listings WHERE listing_id= :listing_id');
+ $stmt = $pdo->prepare('SELECT * FROM auction WHERE listing_id= :listing_id');
$values = [
'listing_id' => $_GET['listing_id']
];
$stmt->execute($values);
$listing = $stmt->fetch();
- $stmt = $pdo->prepare('SELECT * FROM categories WHERE category_id = :category_id');
+ $stmt = $pdo->prepare('SELECT * FROM category WHERE category_id = :category_id');
$values = [
- 'category_id' => $listing['listing_category']
+ 'category_id' => $listing['categoryId']
];
$stmt->execute($values);
$category = $stmt->fetch();
@@ -37,25 +37,25 @@ function populateContent() {
$stmt = $pdo->prepare('SELECT * FROM users WHERE email = :email');
$values = [
- 'email' => $listing['listing_email']
+ 'email' => $listing['email']
];
$stmt->execute($values);
$user = $stmt->fetch();
$output = '
-