MySQL error executing query: 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 ')' at line 3
This problem could be caused by the LemonStand MySQL connection configuration errors. Please log into the LemonStand Configuration Tool and update the database connection parameters. Also please make sure that MySQL server is running.
| Document | /phproad/modules/db/classes/db_mysqldriver.php |
|---|---|
| Document type | PHP document |
| Line | 114 |
| Exception class | Phpr_DatabaseException |
// execute the statement
$handle = @mysql_query($sql, Db::$connection);
// If error, generate exception
if ($err = @mysql_errno(Db::$connection) != 0) {
$exception = new Phpr_DatabaseException('MySQL error executing query: '.@mysql_error(Db::$connection));
$exception->hint_message = 'This problem could be caused by the LemonStand MySQL connection configuration errors. Please log into the LemonStand Configuration Tool and update the database connection parameters. Also please make sure that MySQL server is running.';
throw $exception;
}
return $handle;
}
| # | Call Stack Code | Document | Line |
|---|---|---|---|
| 20 | Db_MySQLDriver->execute('SELECT (pages.url) as page_url, shop_categories.* FROM shop_categories LEFT JOIN pages ON shop_categories.page_id=pages.id WHERE (shop_categories.category_id =)') | /phproad/modules/db/classes/db_sqlbase.php | 1207 |
| 19 | Db_SqlBase->execute('SELECT (pages.url) as page_url, shop_categories.* FROM shop_categories LEFT JOIN pages ON shop_categories.page_id=pages.id WHERE (shop_categories.category_id =)') | /phproad/modules/db/classes/db_sqlbase.php | 873 |
| 18 | Db_SqlBase->query('SELECT (pages.url) as page_url, shop_categories.* FROM shop_categories LEFT JOIN pages ON shop_categories.page_id=pages.id WHERE (shop_categories.category_id =)') | /phproad/modules/db/classes/db_sqlbase.php | 997 |
| 17 | Db_SqlBase->fetchAll('SELECT (pages.url) as page_url, shop_categories.* FROM shop_categories LEFT JOIN pages ON shop_categories.page_id=pages.id WHERE (shop_categories.category_id =)') | /phproad/modules/db/classes/db_activerecord.php | 512 |
| 16 | Db_ActiveRecord->find_all_internal(null, array(0), null) | /phproad/modules/db/classes/db_activerecord.php | 532 |
| 15 | Db_ActiveRecord->find_all(()) | /modules/everest/init/customer_helper.php | 34 |
| 14 | _get_sub_categories(object(Db_DataCollection), array(0)) | /modules/everest/init/customer_helper.php | 55 |
| 13 | get_sub_categories(object(Db_DataCollection)) | /modules/cms/classes/cms_controller.php(383) : eval()'d code | 33 |
| 12 | eval(()) | /modules/cms/classes/cms_controller.php | 383 |
| 11 | Cms_Controller->evalWithException('?><? $this->render_partial('header'); ?> <!-- Additional Header elements --> <? $this->render_head(); ?> </head> <body> <? $this->render_partial('pageheader'); ?> <div id="hero"> <div class="wrap"><img src="<?= theme_resource_url('images/hero-content.jpg'); ?>" width="1000" height="108" /></div> </div><!-- #hero --> <div id="main"> <div class="wrap"> <div id="content" class="left"> <div class="left-side left"> <? $this->render_partial('left_menu', array('category_url_name' => '')); ?> </div> <div id="mid-content"> <? $brand = $this->request_param(0, 0); $keyword = $this->request_param(1, 0); $page_index = $this->request_param(2, 0); $records_per_page = $this->request_param(3, 0); $where = ''; $heading_text = "Search Results"; if ($brand && $brand != 'any') { $heading_text .= " | brand \"$brand\""; $categories = Shop_Category::create()->where("shop_categories.name LIKE '$brand'")->find_all(); if ($categories) { $ids = array(); foreach($categories as $c) $ids[] = $c->id; $sub_cats = get_sub_categories($categories); if (!empty($sub_cats)) { foreach($sub_cats as $cat) $ids[] = $cat->id; } if (!empty($ids)) $where = " (shop_categories.id IN (".implode(',',$ids)."))"; } } if ($keyword) { if ($where != "") $where .= " AND (shop_products.name LIKE '%$keyword%' OR shop_products.description LIKE '%$keyword%' OR shop_products.sku LIKE '%$keyword%' OR shop_option_matrix_records.sku LIKE '%$keyword%')"; else $where = "shop_products.name LIKE '%$keyword%' OR shop_products.description LIKE '%$keyword%' OR shop_products.sku LIKE '%$keyword%' OR shop_option_matrix_records.sku LIKE '%$keyword%' OR shop_categories.name LIKE '%$keyword%'"; $heading_text .= " | keyword \"$keyword\""; } $products = Shop_Product::create() ->apply_filters() ->join('shop_products_categories', 'shop_products_categories.shop_product_id = shop_products.id', "", 'inner') ->join('shop_categories', 'shop_categories.id = shop_products_categories.shop_category_id', "", 'inner') ->join('shop_option_matrix_records', 'shop_option_matrix_records.product_id = shop_products.id') ->order('shop_products.name'); if ($where) $products->where($where); $products->group("shop_products.id"); $page_index = isset($page_index) ? $page_index-1 : 0; $records_per_page = isset($records_per_page) && $records_per_page ? $records_per_page : 5; $pagination = $products->paginate($page_index, $records_per_page); $products = $products instanceof Db_ActiveRecord ? $products->find_all() : $products; $num_of_products = count($products); ?> <div class="product_list left"> <div class="breadcrumb">Search Results</div> <h1 class="page_header"><?=$heading_text?></h1> <? $this->render_partial('product_listing_with_pagination', array( 'products' => $products, 'num_of_products'=> $num_of_products, 'pagination'=>$pagination, 'pagination_base_url'=> root_url("search/$brand/$keyword"), 'records_per_page'=>$records_per_page )); ?> </div> </div><!-- #content --> <div id="sidebar" class="right"> <? $this->render_partial('button_links');?> <? $this->render_partial('compare_list');?> <? $this->render_partial('newsletter_form');?> </div><!-- #sidebar --> <div class="clear"></div> </div> </div><!-- #main --> <? $this->render_partial('footer'); ?>', 'CMS page', 'Search Results') | /modules/cms/classes/cms_controller.php | 608 |
| 10 | Cms_Controller->eval_page_content(()) | /modules/cms/classes/cms_controller.php | 198 |
| 9 | Cms_Controller->open(object(Cms_Page), array(1) [0 => 'lsk5c756a620c5ec2.98675687']) | /controllers/application.php | 72 |
| 8 | Application->On404(()) | ||
| 7 | call_user_func_array(array(2) [0 => object(Application), 1 => 'On404'], array(0)) | /phproad/modules/phpr/classes/phpr_controller.php | 170 |
| 6 | Phpr_Controller->executeAction('On404', array(0)) | /phproad/modules/phpr/classes/phpr_controller.php | 84 |
| 5 | Phpr_Controller->_run('On404', array(0)) | /phproad/modules/phpr/classes/phpr_response.php | 64 |
| 4 | Phpr_Response->open404(()) | /phproad/modules/phpr/classes/phpr_response.php | 37 |
| 3 | Phpr_Response->open('/search/lsk5c756a620c5ec2.98675687') | /phproad/system/phproad.php | 31 |
| 2 | include('/home/everests/public_html/phproad/system/phproad.php') | /boot.php | 114 |
| 1 | require_once('/home/everests/public_html/boot.php') | /index.php | 12 |