bosecom Developer Från United Kingdom Medlem sedan maj 2023 bosecom 11 jan. 2024 20:35 SELECT * FROM lc_products where lc_products.quantity > 0this works fineSELECT * FROM lc_products WHERE lc_products.keywords LIKE '%test%' AND lc_products.quantity > 0this does not the function returns an empty array, using the basic:database::query($query);all help appreciated
dodo Moderator Från Lithuania Medlem sedan mars 2016 dodo 12 jan. 2024 11:33 There is a typo in lc_product.keywords. Should be lc_products.keywordsAnd if you are not using JOIN then your query could be like this instead:SELECT * FROM lc_productsWHERE keywords LIKE '%test%'AND quantity > 0Do you want to be more specific what are you trying to do with this query in the product page?As this is a separate problem from the first one.
bosecom Developer Från United Kingdom Medlem sedan maj 2023 bosecom 12 jan. 2024 12:51 Received by Show Products Object { matchedProducts: [], numberOfResults: 0 }search:810:13No products found or products is not an arraystill shows an empty array using LIKEtried with:SELECT * FROM lc_products WHERE lc_products.keywords LIKE '%acer%' AND lc_products.quantity > 0SELECT * FROM lc_products WHERE keywords LIKE '%acer%' AND lc_products.quantity > 0literally no response when using LIKE,if i run other queries without LIKE it works fine.
tim Founder Från Sweden Medlem sedan maj 2013 tim 12 jan. 2024 14:05 I don't see any errors in your query.What happens if you run the same query in phpMyAdmin?What happens if you skip the quantity condition?You might want to use find_in_set() instead of like for matching a value in a set.
bosecom Developer Från United Kingdom Medlem sedan maj 2023 bosecom 12 jan. 2024 14:07 It works absolutely fine in phpmyadmin and mysql and returns the correct 28 matches, however if i run it from the script the query produces an empty arrayWhat happens if you skip the quantity condition? same resultif you want to anydesk to view what i am doing let me know i can screenshare and show you exactly whats going on
bosecom Developer Från United Kingdom Medlem sedan maj 2023 bosecom 17 jan. 2024 16:32 Issue resolved, it was related to max execution time being set to 600, in mysql 8.2 the time is in milliseconds not seconds.