Search engine is working but using the word "case" throws this warning
Warning: mysqli::query(): (21000/1242): Subquery returns more than 1 row in /public_html/system/library/db/mysqli.php on line 26
line 26 is the query($sql); debugging $sql throws up many queries...
Is "case" a reserved word?
Warning: mysqli::query(): (21000/1242): Subquery returns more than 1 row in /public_html/system/library/db/mysqli.php on line 26
line 26 is the query($sql); debugging $sql throws up many queries...
Is "case" a reserved word?
Last edited by gsc1ugs on Tue Oct 17, 2023 6:12 pm, edited 1 time in total.
It's important for the forum users to have all the necessary information to provide you with the best support possible. As mentioning before the version number of the software you're using is crucial in troubleshooting issues effectively. It streamlines the process and ensures that the advice given is relevant to your specific situation.
If you're unsure about your software OC version, you can find it in the footer of the admin area. Taking a moment to check and include this information in your future posts will greatly aid forum support in assisting you promptly and accurately.
Do you have an SEO extension installed? if so disable/uninstall it and re-test.
also check for a broken / double query and fix it, if there any extensions installed on the site, they may add their own bits to the query which could themselves be causing the error.
from all the errors you are reporting there is somthing wrong with what your doing / done, you will be better off with commercial support for sure.
If you're unsure about your software OC version, you can find it in the footer of the admin area. Taking a moment to check and include this information in your future posts will greatly aid forum support in assisting you promptly and accurately.
Do you have an SEO extension installed? if so disable/uninstall it and re-test.
also check for a broken / double query and fix it, if there any extensions installed on the site, they may add their own bits to the query which could themselves be causing the error.
from all the errors you are reporting there is somthing wrong with what your doing / done, you will be better off with commercial support for sure.
Last edited by WaxedPerfection on Wed Oct 11, 2023 10:11 pm, edited 1 time in total.
https://www.waxedperfection.co.uk/ Car Detailing Product Blog's and Review's
That would suggest you have duplicate entries with the same IDs in one of your database tables. You probably need to work out which query.
I used this query on products came by no resultsADD Creative wrote: ↑Wed Oct 11, 2023 10:03 pmThat would suggest you have duplicate entries with the same IDs in one of your database tables. You probably need to work out which query.
Code: Select all
SELECT product_id, COUNT(product_id) FROM oc_product GROUP BY product_id HAVING COUNT(product_id) > 1
I found the query causing the error on the word "case", i will break it down see which table it could be
Code: Select all
SELECT DISTINCT *, pd.name AS name, p.image, m.name AS manufacturer, (SELECT price FROM oc_product_discount pd2 WHERE pd2.product_id = p.product_id AND pd2.customer_group_id = '1' AND pd2.quantity = '1' AND ((pd2.date_start = '0000-00-00' OR pd2.date_start < NOW()) AND (pd2.date_end = '0000-00-00' OR pd2.date_end > NOW())) ORDER BY pd2.priority ASC, pd2.price ASC LIMIT 1) AS discount, (SELECT price FROM oc_product_special ps WHERE ps.product_id = p.product_id AND ps.customer_group_id = '1' AND ((ps.date_start = '0000-00-00' OR ps.date_start < NOW()) AND (ps.date_end = '0000-00-00' OR ps.date_end > NOW())) ORDER BY ps.priority ASC, ps.price ASC LIMIT 1) AS special, (SELECT points FROM oc_product_reward pr WHERE pr.product_id = p.product_id AND pr.customer_group_id = '1') AS reward, (SELECT ss.name FROM oc_stock_status ss WHERE ss.stock_status_id = p.stock_status_id AND ss.language_id = '1') AS stock_status, (SELECT wcd.unit FROM oc_weight_class_description wcd WHERE p.weight_class_id = wcd.weight_class_id AND wcd.language_id = '1') AS weight_class, (SELECT lcd.unit FROM oc_length_class_description lcd WHERE p.length_class_id = lcd.length_class_id AND lcd.language_id = '1') AS length_class, (SELECT AVG(rating) AS total FROM oc_review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating, (SELECT COUNT(*) AS total FROM oc_review r2 WHERE r2.product_id = p.product_id AND r2.status = '1' GROUP BY r2.product_id) AS reviews, p.sort_order FROM oc_product p LEFT JOIN oc_product_description pd ON (p.product_id = pd.product_id) LEFT JOIN oc_product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN oc_manufacturer m ON (p.manufacturer_id = m.manufacturer_id) WHERE p.product_id = '145' AND pd.language_id = '1' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '0'
The duplicate would not be in oc_product. It's more likely to be in one of the tables use in the SELECTs in that query, such as oc_product_special, oc_stock_status , etc.
The above query throw up this error #1242 - subquery returns more than 1 rowADD Creative wrote: ↑Thu Oct 12, 2023 7:53 pmThe duplicate would not be in oc_product. It's more likely to be in one of the tables use in the SELECTs in that query, such as oc_product_special, oc_stock_status , etc.
I think its time to consider seeking paid support at this point. It's important to recognise that there are limits to what can be reasonably expected from free support, especially when the assistance required becomes more complex and time-consuming.
And with the support ADD Creative and paulfeakins have offered I would suggest one of these as a thank you.
While the community forums are excellent for getting help, extensive or specialised assistance might require dedicated support, which often comes at a cost. Many users find that investing in paid support not only ensures their issues are addressed promptly and comprehensively but also supports the individuals and organisations providing these services.
Considering the complexity of the issue/s you're facing and the amount, it might be a good time to explore professional support options.
Remember, paying for support is an investment in both your success and your peace of mind.
And with the support ADD Creative and paulfeakins have offered I would suggest one of these as a thank you.
While the community forums are excellent for getting help, extensive or specialised assistance might require dedicated support, which often comes at a cost. Many users find that investing in paid support not only ensures their issues are addressed promptly and comprehensively but also supports the individuals and organisations providing these services.
Considering the complexity of the issue/s you're facing and the amount, it might be a good time to explore professional support options.
Remember, paying for support is an investment in both your success and your peace of mind.
https://www.waxedperfection.co.uk/ Car Detailing Product Blog's and Review's
The subquery the errors refer to are the (SELECT ... ) parts in brackets in the query you posted. These will be pulling data from other tables. One of them is probably returning more than it should, maybe due to a duplicate entry.
Who is online
Users browsing this forum: No registered users and 5 guests