Tygh\Exceptions\AException

Message

Table './myglive/fk_products' is marked as crashed and should be repaired (145)

SELECT SQL_CALC_FOUND_ROWS products.product_id, IF(shared_descr.product_id IS NOT NULL, shared_descr.product, descr1.product) as product, IF(shared_prices.product_id IS NOT NULL, MIN(IF (shared_prices.percentage_discount = 0, shared_prices.price, shared_prices.price - (shared_prices.price * shared_prices.percentage_discount) / 100)), MIN(IF (prices.percentage_discount = 0, prices.price, prices.price - (prices.price * prices.percentage_discount) / 100))) as price, products.product_type, products.parent_product_id, 1 as instock_marker, IF( products.product_type = 'C', (SELECT MAX(amount) FROM fk_products WHERE parent_product_id = products.product_id) > 0, IF( IF( products.tracking = 'O', (SELECT MAX(amount) FROM fk_product_options_inventory s_inventory WHERE s_inventory.product_id = products.product_id) > 0, products.amount > 0 ), 1, IF( products.tracking = 'D', 1, 0 ) ) ) as instock_sorting FROM fk_products as products LEFT JOIN fk_product_descriptions as descr1 ON descr1.product_id = products.product_id AND descr1.lang_code = 'en' LEFT JOIN fk_product_prices as prices ON prices.product_id = products.product_id AND prices.lower_limit = 1 INNER JOIN fk_products_categories as products_categories ON products_categories.product_id = products.product_id INNER JOIN fk_categories ON fk_categories.category_id = products_categories.category_id AND (fk_categories.usergroup_ids = '' OR FIND_IN_SET(0, fk_categories.usergroup_ids) OR FIND_IN_SET(1, fk_categories.usergroup_ids)) AND fk_categories.status IN ('A', 'H') LEFT JOIN fk_ult_product_descriptions shared_descr ON shared_descr.product_id = products.product_id AND shared_descr.company_id = 1 AND shared_descr.lang_code = 'en' LEFT JOIN fk_ult_product_prices as shared_prices ON shared_prices.product_id = products.product_id AND shared_prices.lower_limit = 1 AND shared_prices.usergroup_id IN (0, 0, 1) AND shared_prices.company_id = 1 WHERE 1 AND fk_categories.category_id IN (234, 235, 236, 237, 238, 240, 264, 265, 266, 268, 307, 314, 316, 319, 323, 339, 371, 463, 552, 572, 604, 621) AND fk_categories.company_id = 1 AND (products.usergroup_ids = '' OR FIND_IN_SET(0, products.usergroup_ids) OR FIND_IN_SET(1, products.usergroup_ids)) AND products.status IN ('A') AND prices.usergroup_id IN (0, 0, 1) AND products.parent_product_id = 0 GROUP BY products.product_id ORDER BY instock_sorting DESC, price asc, products.product_id ASC LIMIT 0, 96

Error at

app/Tygh/Database/Connection.php, line: 1155

Backtrace

File:app/Tygh/Database/Connection.php
Line:518
Function:throwError
File:app/Tygh/Database/Connection.php
Line:226
Function:query
File:app/functions/fn.database.php
Line:31
Function:getArray
File:app/functions/fn.products.php
Line:2171
Function:db_get_array
File:app/functions/fn.products.php
Line:2247
Function:{closure}
File:app/controllers/frontend/categories.php
Line:114
Function:fn_get_products
File:app/functions/fn.control.php
Line:685
Function:include
File:app/functions/fn.control.php
Line:434
Function:fn_run_controller
File:index.php
Line:25
Function:fn_dispatch