updated db info
This commit is contained in:
parent
88aebe81ac
commit
d420691460
2
db.php
2
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();
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 .= '<li>
|
||||
<img src="assets/product.png" alt="product name">
|
||||
<article>
|
||||
<h2>'. $listing['name'] .'</h2>
|
||||
<h2>'. $listing['title'] .'</h2>
|
||||
<h3>'. $listing['categoryId'] .'</h3>
|
||||
<p>'. $listing['description'] .'</p>
|
||||
<p class="price">Current bid:'. $stmt->fetch()['MAX(amount)'] .'</p>
|
||||
|
|
|
|||
|
|
@ -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 = ' <img src="product.png" alt="product name">
|
||||
<section class="details">
|
||||
<h2>'. $listing['name'] .'</h2>
|
||||
<h2>'. $listing['title'] .'</h2>
|
||||
<h3>'. $category['name'] .'</h3>
|
||||
<p>Auction created by <a href="#">'. $user['first_name'].$user['last_name'] .'</a></p>
|
||||
<p class="price">Current bid: '. $bid['MAX(amount)'] .'</p>
|
||||
|
|
|
|||
Loading…
Reference in New Issue