aboutsummaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
Diffstat (limited to 'public')
-rw-r--r--public/index.php2
-rw-r--r--public/product.php2
-rw-r--r--public/products.php4
3 files changed, 4 insertions, 4 deletions
diff --git a/public/index.php b/public/index.php
index 653962c..84dc753 100644
--- a/public/index.php
+++ b/public/index.php
@@ -13,7 +13,7 @@
<h1>hier zijn de aanbiedingen</h1>
<ul>
<?php
- $res = $cursor->query("select product.ID as id, product.name as name from promotion join product on product.ID = promotion.product");
+ $res = $cursor->query("select product.id, product.name as name from promotion join product on product.id = promotion.product");
while ($product = $res->fetch_object()) {
echo "<li><a href=\"/product.php?id=$product->id\">$product->name</a></li>";
}
diff --git a/public/product.php b/public/product.php
index 3e6a89f..7db5b5e 100644
--- a/public/product.php
+++ b/public/product.php
@@ -6,7 +6,7 @@ function refuse() {
die();
}
-$statement = $cursor->prepare("select ID as id, image, price, name, description from webs.product where ID = ?");
+$statement = $cursor->prepare("select id, image, price, name, description from webs.product where id = ?");
$statement->bind_param("i", $_GET['id']);
if (!$statement->execute()) refuse();
$res = $statement->get_result();
diff --git a/public/products.php b/public/products.php
index bffaeb0..fd3e2a1 100644
--- a/public/products.php
+++ b/public/products.php
@@ -2,7 +2,7 @@
<?php require "db.php"; ?>
<?php
function product_template($product) {
- $image_path = $product->img ? "/img/product/$product->id-thumb.jpg" : "/img/placeholder.png";
+ $image_path = $product->image ? "/img/product/$product->id-thumb.jpg" : "/img/placeholder.png";
echo <<<"EOF"
<a href="/product.php?id=$product->id" class="product nolinkstyle">
<img src="$image_path" alt="">
@@ -24,7 +24,7 @@ EOF;
<h2>lijst met producten:</h2>
<div class="products">
<?php
- $res = $cursor->query("select ID as id, image as img, price, name from webs.product");
+ $res = $cursor->query("select id, image, price, name from webs.product");
while ($product = $res->fetch_object()) product_template($product);
?>
</div>