Originally Posted by
Rock-n-Roll
I was hoping you could offer a tip or 2 on how to fix the following issue. I have searched the forums without any luck so I am assuming it may of been caused by my actions when adding a mod rather than a script issue.
Perhaps - but possibly not.
Originally Posted by
Rock-n-Roll
I just noticed a large number of error log files similar to the one below, the only variance between the errors is the product id. I have replaced paths and DB names with xxx's.
[17-Nov-2015 00:33:25 UTC] PHP Fatal error: 1055:'xxx.p.products_image'
It may it my not be important, but I would have liked to seen the actual contents that you've replaced by these 'xxx'.
Originally Posted by
Rock-n-Roll
select p.products_id, p.products_image
from orders_products opa, orders_products opb, orders o, products p
where opa.products_id = '678'
and opa.orders_id = opb.orders_id
and opb.products_id != '678'
and opb.products_id = p.products_id
and opb.orders_id = o.orders_id
and p.products_status = 1
group by p.products_id
order by o.date_purchased desc
limit 6
I've copied and pasted this into the SQL box in one of our own servers, and the SQL query itself appears to work just fine. I get the expected results when using a valid product_id for our store, and zero results (no errors) when using an id that doesn't exist.
This lead me to a Google search, which then led me to here:
http://dev.mysql.com/doc/refman/5.7/...-handling.html
In other words, the problem looks like it may be related to a MySQL version issue.
It looks like there are three possible solutions
1) Revert back to an earlier version of MySQL
2) enable or disable the (apparently new) ONLY_FULL_GROUP_BY option (not sure which or how, at the moment) or
3) Update the SQL so that complies with the new requirements.
To prove/disprove this theory/possibilty, my approach would be
Load the file /includes/classes/db/mysql/define_queries.php into a text editor, and edit it to read
Code:
DEFINE('SQL_ALSO_PURCHASED', "select p.products_id, p.products_image
from " . TABLE_ORDERS_PRODUCTS . " opa, " . TABLE_ORDERS_PRODUCTS . " opb, "
. TABLE_ORDERS . " o, " . TABLE_PRODUCTS . " p
where opa.products_id = '%s'
and opa.orders_id = opb.orders_id
and opb.products_id != '%s'
and opb.products_id = p.products_id
and opb.orders_id = o.orders_id
and p.products_status = 1
group by p.products_id , p.products_image
order by o.date_purchased desc
limit " . MAX_DISPLAY_ALSO_PURCHASED);
IOW, add the stuff I've highlighted.
Please let me know your results. I could be barking up the wrong tree.
Cheers
RodG
Bookmarks