Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Database (Error) Rate Topic   - - - - -

 
  • osama moqbal
  • Advanced Member
  • Members
  • Join Date: 10-Jun 18
  • 62 posts

Posted 02 September 2018 - 06:18 AM #1

there is tow database error happen can any one help me to know what is the problem .

 

Database (error)
Error: Column 'list_price' in field list is ambiguous <b>(1052)</b>
Query: SELECT SQL_CALC_FOUND_ROWS products.product_id, IF(shared_descr.product_id IS NOT NULL, shared_descr.product, descr1.product) as product, 100 - ((prices.price * 100) / list_price) AS sales_discount, 1 as instock_marker, IF( products.product_type = 'C', (SELECT MAX(amount) FROM cscart_products WHERE parent_product_id = products.product_id) > 0, IF( IF( products.tracking = 'O', (SELECT MAX(amount) FROM cscart_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 cscart_products as products LEFT JOIN cscart_product_descriptions as descr1 ON descr1.product_id = products.product_id AND descr1.lang_code = 'en' LEFT JOIN cscart_product_prices as prices ON prices.product_id = products.product_id AND prices.lower_limit = 1 INNER JOIN cscart_products_categories as products_categories ON products_categories.product_id = products.product_id INNER JOIN cscart_categories ON cscart_categories.category_id = products_categories.category_id AND (cscart_categories.usergroup_ids = '' OR FIND_IN_SET(0, cscart_categories.usergroup_ids) OR FIND_IN_SET(1, cscart_categories.usergroup_ids)) AND cscart_categories.status IN ('A', 'H') LEFT JOIN cscart_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' INNER JOIN cscart_products product_amount ON (product_amount.product_id = products.product_id AND product_amount.amount > 0 AND product_amount.tracking IN ('B','D')) OR (product_amount.product_id = products.product_id AND product_amount.tracking IN ('O')) WHERE 1 AND cscart_categories.category_id IN (257, 258, 326, 260, 281) AND cscart_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.product_type IN ('P', 'C') GROUP BY products.product_id ORDER BY instock_sorting DESC, sales_discount desc, product_id ASC LIMIT 144, 16

Backtrace››

index.php (fn_dispatch): 25
app/functions/fn.control.php (fn_run_controller): 460
app/functions/fn.control.php (include): 702
app/controllers/frontend/categories.php (fn_get_products): 94
app/functions/fn.catalog.php ({closure}): 7126
app/functions/fn.catalog.php (db_get_array): 7050
app/functions/fn.database.php (getArray): 32
app/Tygh/Database/Connection.php (call_user_func_array): 229
app/Tygh/Database/Connection.php (query): 489
 
then these error came after 

 

Database (error)

Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?:categories.company_id = 1 AND (products.usergroup_ids = '' OR FIND_IN_SET(0, p' at line 1 <b>(1064)</b>

Query: SELECT cscart_product_filters.filter_id, cscart_product_features_values.variant_id FROM cscart_product_features_values LEFT JOIN cscart_products as products ON products.product_id = cscart_product_features_values.product_id LEFT JOIN cscart_product_filters ON cscart_product_filters.feature_id = cscart_product_features_values.feature_id LEFT JOIN cscart_product_features ON cscart_product_features.feature_id = cscart_product_features_values.feature_id LEFT JOIN cscart_product_descriptions as descr_live ON descr_live.product_id=products.product_id AND descr_live.lang_code='en' LEFT JOIN cscart_product_options as p_options ON products.product_id=p_options.product_id LEFT JOIN cscart_product_global_option_links as g_options ON products.product_id=g_options.product_id LEFT JOIN cscart_product_features_values as pf_values ON products.product_id=pf_values.product_id AND pf_values.lang_code='en' LEFT JOIN cscart_product_feature_variant_descriptions as pf_variants ON pf_variants.variant_id=pf_values.variant_id INNER JOIN cscart_products_categories as products_categories ON products_categories.product_id = products.product_id INNER JOIN cscart_categories ON cscart_categories.category_id = products_categories.category_id AND (cscart_categories.usergroup_ids = '' OR FIND_IN_SET(0, cscart_categories.usergroup_ids) OR FIND_IN_SET(1, cscart_categories.usergroup_ids)) AND cscart_categories.status IN ('A', 'H') WHERE cscart_product_filters.filter_id IN (1, 10, 8, 20, 25, 11, 24, 17, 22, 14, 21, 15, 16, 18) AND cscart_product_features_values.feature_id IN (18, 16, 57, 81, 50, 85, 54, 80, 70, 79, 61, 77, 55) AND cscart_product_features_values.lang_code = 'en' AND NOT FIND_IN_SET('unexisting/../../../../../../../../../../windows/win.ini.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\ \\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\%' OR descr_live.search_words LIKE '%unexisting/../../../../../../../../../../windows/win.ini.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.\ 

(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 products.product_type IN ('P', 'C') AND cscart_product_features.feature_type IN ('S', 'M', 'E') GROUP BY cscart_product_features_values.variant_id

Backtrace››

 

index.php (fn_dispatch): 25

app/functions/fn.control.php (fetch): 618

app/Tygh/SmartyEngine/Core.php (fetch): 76

app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php (content_5b87851c5c02d3_72930221): 188

var/cache/templates/abt__unitheme/db84391954e84e3b67bb67ccb3dc9e6d51a631e8.tygh.index.tpl.php (smarty_function_render_location): 166

app/functions/smarty_plugins/function.render_location.php (render): 48

app/Tygh/BlockManager/RenderManager.php (_renderContainer): 155

app/Tygh/BlockManager/RenderManager.php (renderGrids): 191

app/Tygh/BlockManager/RenderManager.php (renderGrid): 221

app/Tygh/BlockManager/RenderManager.php (renderBlocks): 356

app/Tygh/BlockManager/RenderManager.php (renderBlock): 394

app/Tygh/BlockManager/RenderManager.php (renderBlockContent): 450

app/Tygh/BlockManager/RenderManager.php (getValue): 603

app/Tygh/BlockManager/RenderManager.php (getItems): 733

app/Tygh/BlockManager/Block.php (call_user_func): 809

app/addons/searchanise/func.php (fn_searchanise_get_filters_products_count): 1061

app/functions/fn.catalog.php (fn_get_current_filters): 10346

app/functions/fn.catalog.php (db_get_hash_single_array): 10808

app/functions/fn.database.php (getSingleHash): 107

app/Tygh/Database/Connection.php (call_user_func_array): 376

app/Tygh/Database/Connection.php (query): 489



 
  • soft-solid
  • Junior Member
  • Members
  • Join Date: 19-Apr 10
  • 488 posts

Posted 02 September 2018 - 12:57 PM #2

Hello.

 

I think there is an error in the sql query.
It should be "products.list_price" and not "list_price".
 
Best regards
Robert

Team of SoftSolid
cs-cart.pl

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10945 posts

Posted 02 September 2018 - 10:06 PM #3

An addon is probably using a hook to modify the fields being searched or the tables in the JOIN(s).  You should contact the developer to have them correct their hook.  It is whatever addon is trying to generate the filed 'sales_discount'.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • osama moqbal
  • Advanced Member
  • Members
  • Join Date: 10-Jun 18
  • 62 posts

Posted 03 September 2018 - 05:25 AM #4

 

Hello.

 

I think there is an error in the sql query.
It should be "products.list_price" and not "list_price".
 
Best regards
Robert

 

i find some one else tell about same problem and the solution from eCom-lab was that 

 $fields[] = '100 - ((prices.price * 100) / products.list_price) AS sales_discount';

 

its work fine for me till now , no error happen again .

but its work fine in the past, what cause the problem ? my be the live search add-on cause these problem ! 



 
  • osama moqbal
  • Advanced Member
  • Members
  • Join Date: 10-Jun 18
  • 62 posts

Posted 03 September 2018 - 05:27 AM #5

An addon is probably using a hook to modify the fields being searched or the tables in the JOIN(s).  You should contact the developer to have them correct their hook.  It is whatever addon is trying to generate the filed 'sales_discount'.

thank you EZ for your help , i think the live search add-on make these problem . there is also some error searching in search history for these addon . 

 

thank you all for your help 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18335 posts

Posted 03 September 2018 - 01:05 PM #6

Try to temporary disable this module and monitor the situation


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • osama moqbal
  • Advanced Member
  • Members
  • Join Date: 10-Jun 18
  • 62 posts

Posted 04 September 2018 - 05:13 AM #7

Try to temporary disable this module and monitor the situation

the company give fix for the add-on , 

there is some one is try to make SQL injection,  and i contact the host about the problem and they scan my file and database . 

thank you eComlabs  for your help