2
« on: March 13, 2019, 10:57:03 AM »
WHAT I'M SEEING:
There has been a critical error processing your request
SQL Error: Error No: 0
SQL: in /home/xxxxx/public_html/xxxx/xxxx/core/database/amysqli.php on line 114
(I have removed folder names for secuity's sake)
MY PURPOSE:
I'm testing the ability to add a simple db query on the storefront/view/default/template/common/success.tpl page and to return two lines of results to the page for the user. This is in preparation for adding code for other backend actions.
WHAT I DID:
I inserted the query in the success.tpl file, based on syntax found in storefront/model/checkout/order.php (line 152).
QUERY I ADDED IS IN RED:
[LINE 8] <section class="mb40">
<h4 class="hidden"> </h4>
<p><?php echo $text_message; ?></p>
<?php $query = $this->db->query("SELECT MAX(order_id) AS order_id FROM `".$this->db->table("orders")."`");
$result = $this->db->query($sql);
$row = $result->row;
echo $row['order_id'];
echo $row['firstname'];
?>
<a href="<?php echo $continue; ?>" class="btn btn-default mr10" title="<?php echo $continue_button->text ?>">
<i class="fa fa-arrow-right"></i>
<?php echo $continue_button->text ?>
</a>
</section>
What am I missing? The error shown isn't explicit enough to hint at the problem.
Thank you in advance for help.
RIGRAX