From 669791387b937b22624d07544b47c0e009dc9f9e Mon Sep 17 00:00:00 2001 From: Joshua Perry <45966243+jpez-development@users.noreply.github.com> Date: Sun, 20 Nov 2022 20:14:56 +0000 Subject: [PATCH] added delete button to editAuction --- functions.php | 4 ++-- public/account/editAuction.php | 11 ++++++++++- todo.txt | 2 -- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/functions.php b/functions.php index 0004ba5..e7a5cd7 100644 --- a/functions.php +++ b/functions.php @@ -19,7 +19,7 @@ function adminCheck() { } } -function startDB() { +function startDB() { // Code for connecting to the database from https://www.sitepoint.com/re-introducing-pdo-the-right-way-to-access-databases-in-php/ $server = 'mysql'; $username = 'student'; $password = 'student'; @@ -84,7 +84,7 @@ function getFirstAllMatches($tableName, $constraintCol, $constraint) { return executeAllQuery($tableName, $constraintCol, $constraint)->fetch(); } -function imageUpload($name) { +function imageUpload($name) { //Code for uploading an image. Modified from https://www.w3schools.com/php/php_file_upload.asp $imgDir = 'public/images/auctions/'; $file = $imgDir . $name; $okFlag = true; diff --git a/public/account/editAuction.php b/public/account/editAuction.php index 0dbffc0..99a7962 100644 --- a/public/account/editAuction.php +++ b/public/account/editAuction.php @@ -4,7 +4,6 @@ $stylesheet = '../assets/ibuy.css'; require_once '../../functions.php'; checkListing(); -$pdo = startDB(); $listing = getListing(); $pageContent = '