SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') ELSE `swatches_products`.price END as price FROM `hob_swatches` AS `swatches` ' at line 1

/home/hob/public_html/modules/db/classes/query.php(1295)

1290             echo $this->interpolate();
1291             exit();
1292         }
1293         if ($this->mode == "delete") $this->validate(query::PHASE_BEFORE_DELETE);
1294         $records = $this->db->prepare($this->sql);
1295         $records->execute($params);
1296         $this->executed = true;
1297         if ($this->mode == "query") {
1298             $rows = $records->fetchAll(PDO::FETCH_ASSOC);
1299             $this->result = $rows;
1300             return ((!empty($this->query['limit'])) && ($this->query['limit'] == 1)) ? $rows[0] : $rows;

Stack Trace

#0
+
 /home/hob/public_html/modules/db/classes/query.php(1295): PDOStatement->execute(array(":default0" => ""))
1290             echo $this->interpolate();
1291             exit();
1292         }
1293         if ($this->mode == "delete") $this->validate(query::PHASE_BEFORE_DELETE);
1294         $records = $this->db->prepare($this->sql);
1295         $records->execute($params);
1296         $this->executed = true;
1297         if ($this->mode == "query") {
1298             $rows = $records->fetchAll(PDO::FETCH_ASSOC);
1299             $this->result = $rows;
1300             return ((!empty($this->query['limit'])) && ($this->query['limit'] == 1)) ? $rows[0] : $rows;
#1
+
 /home/hob/public_html/modules/db/classes/query.php(1316): query->execute()
1311             return $this->record_count;
1312         }
1313     }
1314 
1315     function one() {
1316         return $this->limit(1)->execute();
1317     }
1318 
1319     function all() {
1320         $records = $this->execute();
1321         return ((!empty($this->query['limit'])) && ($this->query['limit'] == 1)) ? array($records) : $records;
#2
+
 /home/hob/public_html/app/views/shop/suits/show.php(15): query->one()
10                         $swatch->join("products_photos")->on("swatches.products_id=products_photos.products_id");
11                         $swatch->join("files")->on("products_photos.photos_id=files.id");
12                         $swatch->group("swatches.id");
13                         $swatch->select("CONCAT(files.id, '_', files.filename) as photo");
14                         $swatch->select("CASE WHEN swatches.price='0' THEN (SELECT price FROM ".P("grades")." g WHERE g.name=swatches.grade && g.type=".$product['type'].") ELSE swatches.price END as price");
15                         $swatch = $swatch->one();
16                         $images = array($product['thumbnail'], $product['closeup']);
17                         $photos = query("products_photos")->condition("products_id", $product['products_id'])->select("CONCAT(products_photos.photos_id, '_', products_photos.photos_id.filename) as photo")->all();
18                         foreach ($photos as $photo) $images[] = $photo['photo'];
19                         $images[] = $swatch['photo'];
20                     ?>
#6
+
 /home/hob/public_html/core/app/templates/view.php(3): Template->render_view("shop/suits/show")
1 <?php
2     $view = empty($request->file) ? $request->uri[0] : $request->file;
3     $this->render_view($view);
4 ?>
#9
+
 /home/hob/public_html/app/themes/hob/layouts/views.php(9): Template->render("view")
04             $this->render("breadcrumbs", array(
05                 "trail" => request()->breadcrumbs,
06                 "active" => request()->title
07             ));
08         ?>
09         <?php $this->render("view"); ?>
10     </div>
11 </div>
#13
+
 /home/hob/public_html/core/app/templates/layout.php(2): Template->render_layout(array("views-shop/suits/show/", "views", "Default"))
1 <?php
2     $this->render_layout(array($request->layout."-".$request->path, $request->layout, "Default"));
3 ?>
#16
+
 /home/hob/public_html/app/themes/hob/templates/main.php(18): Template->render("layout")
13                     </div>
14             </div>
15     </div>
16 </div>
17 <?php } ?>
18 <?php $this->render("layout"); ?>
#19
+
 /home/hob/public_html/core/app/templates/region.php(2): Template->render(array("shop-main", "main"))
1 <div id="<?php echo $region; ?>" class="region">
2     <?php $route = request()->payload['path']; $this->render(array($route."-".$region, $region)); ?>
3 </div>
#22
+
 /home/hob/public_html/core/app/templates/regions.php(1): Template->render("region", array("region" => "main"))
1 <?php foreach(theme("regions") as $region) $this->render("region", array("region" => $region)); ?>
#25
+
 /home/hob/public_html/core/app/templates/page.php(2): Template->render("regions")
1 <div class="page <?php echo request("layout"); ?>">
2     <?php $this->render("regions"); ?>
3 </div>
#28
+
 /home/hob/public_html/core/app/templates/html.php(7): Template->render("page")
02 <html lang="en">
03     <head>
04         <?php $this->publish("head"); ?>
05     </head>
06     <body class="dbootstrap">
07         <?php $this->render("page"); ?>
08         <?php $this->publish("footer"); ?>
09     </body>
10 </html>
#32
+
 /home/hob/public_html/core/app/templates/controller-group.php(5): Controller->action("show", array(""))
1 <?php
2     list($base, $controller, $action) = $request->uri;
3     $object = $sb->locator->get_module_class("controllers/".ucwords($base).ucwords(str_replace("-", "_", $controller))."Controller", "lib/Controller", "core");
4     $instance = new $object($this);
5     $instance->action($action, array_slice($request->uri, 3));
6 ?>
#36
+
 /home/hob/public_html/index.php(21): Request->execute()
16  * @ingroup global
17  */
18 global $request;
19 $request = new Request($context, $locator);
20 $request->set_path($_SERVER['HTTP_HOST'], $_SERVER['REQUEST_URI']);
21 $request->execute();
22 ?>
2017-11-17 16:39:03