Post by ludwingdelacruz » Tue Sep 22, 2015 9:48 am

Hi I am new to the forum, I an I need some help on the following error, thank you.


Warning: mysqli::query(): (21000/1242): Subquery returns more than 1 row in /home/venomvap/public_html/store/system/library/db/mysqli.php on line 18Notice: Error: Subquery returns more than 1 row
Error No: 1242
SELECT DISTINCT *, (SELECT GROUP_CONCAT(cd1.name ORDER BY level SEPARATOR ' > ') FROM vv_category_path cp LEFT JOIN vv_category_description cd1 ON (cp.path_id = cd1.category_id AND cp.category_id != cp.path_id) WHERE cp.category_id = c.category_id AND cd1.language_id = '1' GROUP BY cp.category_id) AS path, (SELECT DISTINCT keyword FROM vv_url_alias WHERE query = 'category_id=56') AS keyword FROM vv_category c LEFT JOIN vv_category_description cd2 ON (c.category_id = cd2.category_id) WHERE c.category_id = '56' AND cd2.language_id = '1' in /home/venomvap/public_html/store/system/library/db/mysqli.php on line 40Notice: Trying to get property of non-object in /home/venomvap/public_html/store/admin/model/catalog/category.php on line 213

Thanks!

-Ludwing


Posts

Joined
Tue Sep 22, 2015 9:47 am

Post by GoldenScrew » Thu Sep 22, 2016 2:43 pm

Hello, I have same error, do you have solution for this?

Newbie

Posts

Joined
Thu Sep 22, 2016 2:42 pm

Post by OSWorX » Thu Sep 22, 2016 11:42 pm

Basically to gather help, we would need more infos.

1. which shopversion are you using
2. is the shop modified
3. whcih server type
4. which php-version

This just for a 'starting' point.

Image


User avatar
Expert Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by artcore » Fri Sep 23, 2016 1:57 am

It's probably this part:
SELECT DISTINCT keyword FROM vv_url_alias WHERE query = 'category_id=56') AS keyword

You have multiple entries in your url_alias table for this category id. You can delete them via phpmyadmin and hope it's not returning because of some SEO extension or from an import maybe.

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: I moved on to Laravel ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by frank.personnel » Sat Nov 18, 2017 1:55 am

you can add the following code to your query part : language_id = '" . (int)$this->config->get('config_language_id') . "'
before -> $query = $this->db->query("SELECT DISTINCT *, (SELECT keyword FROM " . DB_PREFIX . "url_alias WHERE query = 'product_id=" . (int)$product_id . "') AS keyword FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE p.product_id = '" . (int)$product_id . "' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "'");
After -> $query = $this->db->query("SELECT DISTINCT *, (SELECT keyword FROM " . DB_PREFIX . "url_alias WHERE query = 'product_id=" . (int)$product_id . "' and language_id = '" . (int)$this->config->get('config_language_id') . "') AS keyword FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE p.product_id = '" . (int)$product_id . "' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "'");
And Yippi. It solved issue. :)


Posts

Joined
Sat Nov 18, 2017 1:37 am
Who is online

Users browsing this forum: No registered users and 8 guests