SQLSTATE[42000]: Syntax error or access violation: 1064 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 'ORDER BY RAND() LIMIT 25' at line 14SELECT c.parent_id, p.id as product_id, p.*, v.var_id, v.*
FROM spacium_product_bases p
JOIN (
SELECT v1.id as var_id, v1.* from spacium_product_variants v1
WHERE v1.discounted_price = (SELECT MIN(discounted_price) FROM spacium_product_variants WHERE base_id=v1.base_id AND is_active=1 AND is_approved=1 )
) as v ON p.id = v.base_id
LEFT join core_category c ON c.id=p.category_id
WHERE p.is_active=:active
AND p.product_approved=1
AND is_product_category=1
AND v.is_active=1
AND v.is_approved=1
AND p.category_id= ORDER BY RAND() LIMIT 25SQL: [794] SELECT c.parent_id, p.id as product_id, p.*, v.var_id, v.*
FROM spacium_product_bases p
JOIN (
SELECT v1.id as var_id, v1.* from spacium_product_variants v1
WHERE v1.discounted_price = (SELECT MIN(discounted_price) FROM spacium_product_variants WHERE base_id=v1.base_id AND is_active=1 AND is_approved=1 )
) as v ON p.id = v.base_id
LEFT join core_category c ON c.id=p.category_id
WHERE p.is_active=:active
AND p.product_approved=1
AND is_product_category=1
AND v.is_active=1
AND v.is_approved=1
AND p.category_id= ORDER BY RAND() LIMIT 25
Sent SQL: [790] SELECT c.parent_id, p.id as product_id, p.*, v.var_id, v.*
FROM spacium_product_bases p
JOIN (
SELECT v1.id as var_id, v1.* from spacium_product_variants v1
WHERE v1.discounted_price = (SELECT MIN(discounted_price) FROM spacium_product_variants WHERE base_id=v1.base_id AND is_active=1 AND is_approved=1 )
) as v ON p.id = v.base_id
LEFT join core_category c ON c.id=p.category_id
WHERE p.is_active='1'
AND p.product_approved=1
AND is_product_category=1
AND v.is_active=1
AND v.is_approved=1
AND p.category_id= ORDER BY RAND() LIMIT 25
Params: 1
Key: Name: [7] :active
paramno=-1
name=[7] ":active"
is_param=1
param_type=2
Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /home/spaciumtech/public_html/product_detail.php:640
Stack trace:
#0 {main}
thrown in /home/spaciumtech/public_html/product_detail.php on line 640