Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Select Count Distinct Error


carolinaseo

Recommended Posts

Posted

I'm getting the following error in Best Customer Orders-Total (/shop/admin/stats_customers.php):

 

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 '*) as total from customers c, orders_products op, orders o where c.customers_id' at line 1

 

select count(distinct *) as total from customers c, orders_products op, orders o where c.customers_id = o.customers_id and o.orders_id = op.orders_id

 

Similar error in Best Products Purchased (/shop/admin/stats_products_purchased.php):

 

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 '*) as total from products p, products_description pd where pd.products_id = p.p' at line 1

 

select count(distinct *) as total from products p, products_description pd where pd.products_id = p.products_id and pd.language_id = '1' and p.products_ordered > 0

 

What can I do to fix this?

 

Thanks in advance!

Posted
I'm getting the following error in Best Customer Orders-Total (/shop/admin/stats_customers.php):

 

select count(distinct *) as total from customers c, orders_products op, orders o where c.customers_id = o.customers_id and o.orders_id = op.orders_id

 

What can I do to fix this?

I'm pretty sure you can fix that by adding the field you want to count between quotes as the third variable in the "split" part.

 

For example:

$specials_split = new splitPageResults($specials_query_raw, MAX_DISPLAY_SPECIAL_PRODUCTS, 'p.products_id');

You would probably need something like 'o.orders_id' as the third variable.

 

Is there no thread for this contribution in the General Contribution Support forum?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...