Trying to get info from a table to display on my html front. But it doesn't want to.
functions file
function get_products()
{
$query = query(" SELECT * FROM products");
confirm($query);
while($row = fetch_array($query))
{
$product = <<<DELIMETER
<div class="col-sm-4 col-lg-4 col-md-4">
<div class="thumbnail">
<img src="http://placehold.it/320x150" alt="">
<div class="caption">
<h4 class="pull-right">{$row['product_price']}</h4>
<h4><a href="#">Fifth Product</a>
</h4>
<p>This is a short description. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<a class="btn btn-primary" target="_blank" href="http://maxoffsky.com/code-blog/laravel-shop-tutorial-1-building-a-review-system/">View Tutorial</a>
</div>
</div>
</div>
DELIMETER;
echo $product;
}
}
html
<?php
require_once("../resources/config.php");
?>
<?php
include(TEMPLATE_FRONT . DS . "header.php");
?>
<!--
<div class="container">
<div class="row">
<?php
include(TEMPLATE_FRONT . DS . "side_nav.php");
?>
<div class="col-md-9">
<div class="row carousel-holder">
<div class="col-md-12">
<?php
include(TEMPLATE_FRONT . DS . "slider.php");
?>
</div>
</div>
<div class="row">
<?php
get_products();
?>
</div> <!--
</div>
</div>
</div>
<!--
<?php
include(TEMPLATE_FRONT . DS . "footer.php");
?>
And config that links two file, just in case
<?php
ob_start();
session_start();
defined("DS") ? null : define("DS", DIRECTORY_SEPARATOR);
defined("TEMPLATE_FRONT") ? null : define("TEMPLATE_FRONT", __DIR__ . DS . "template/front");
defined("TEMPLATE_BACK") ? null : define("TEMPLATE_BACK", __DIR__ . DS . "template/back");
defined("DB_HOST") ? null : define("DB_HOST", "localhost");
defined("DB_USER") ? null : define("DB_USER", "root");
defined("DB_PASS") ? null : define("DB_PASS", "mysql");
defined("DB_NAME") ? null : define("DB_NAME", "ecom_db");
$connection = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
require_once("functions.php");
What I have tried:
Tried fixing the syntax and looking at different code to get the same result.