carlwhat:
ok. GREAT stuff....
i'm not sure you are on the page that creates the error. this looks to be the specials page. and the problem is coming from the all-products page.
looking at the "code" from the debug shows the 2 lines for the variable, $count_query. they are the last 2 lines. the first line is echoed on line 40; the second line is echoed on line 76. and from the debug logs, it is line 78 is when we get the error. and line 78 is executing the $count_query.
from the debug logs, we have the following error:
Unknown table 'p' in field list :: select count(p.products_id) as total
and yet from the display of $count_query we have:
select count(*) as total FROM.....
the sql statements are different.... so from my standpoint, we can not be on the page that creates the error.
in addition, if we were to run the complete sql statement contained in the variable $count_query using phpmyadmin or any other sql db interface:
select count(*) as total FROM (products p LEFT JOIN specials s on p.products_id = s.products_id LEFT JOIN products_description pd on p.products_id = pd.products_id ) WHERE p.products_id = s.products_id and p.products_id = pd.products_id and p.products_status = '1' AND s.status = 1 AND pd.language_id = 1
my test dataset returns completely fine.
lets get the same 4 debug outputs from the page that creates the error.
This error triggers on the Specials,New Products,All Products and featured Product pages. When I run the statements via phpmyadmin, they all produce results
All products link:
original_query=SELECT p.products_type, p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status, p.master_categories_id FROM products p LEFT JOIN manufacturers m ON (p.manufacturers_id = m.manufacturers_id), products_description pd WHERE p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 1 order by pd.products_name
original_count_query=
sql_query=SELECT p.products_type, p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status, p.master_categories_id FROM products p LEFT JOIN manufacturers m ON (p.manufacturers_id = m.manufacturers_id), products_description pd WHERE p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 1 order by pd.products_name
count_query=SELECT p.products_type, p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status, p.master_categories_id FROM products p LEFT JOIN manufacturers m ON (p.manufacturers_id = m.manufacturers_id), products_description pd WHERE p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 1 order by pd.products_name
count_query=select count(*) as total FROM products p LEFT JOIN manufacturers m ON (p.manufacturers_id = m.manufacturers_id), products_description pd WHERE p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 1
New products link:
original_query=SELECT p.products_id, p.products_type, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status, p.master_categories_id FROM products p LEFT JOIN manufacturers m ON (p.manufacturers_id = m.manufacturers_id), products_description pd WHERE p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 1 order by p.products_date_added DESC, pd.products_name
original_count_query=
sql_query=SELECT p.products_id, p.products_type, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status, p.master_categories_id FROM products p LEFT JOIN manufacturers m ON (p.manufacturers_id = m.manufacturers_id), products_description pd WHERE p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 1 order by p.products_date_added DESC, pd.products_name
count_query=SELECT p.products_id, p.products_type, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status, p.master_categories_id FROM products p LEFT JOIN manufacturers m ON (p.manufacturers_id = m.manufacturers_id), products_description pd WHERE p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 1 order by p.products_date_added DESC, pd.products_name
count_query=select count(*) as total FROM products p LEFT JOIN manufacturers m ON (p.manufacturers_id = m.manufacturers_id), products_description pd WHERE p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 1
Featured products:
original_query=SELECT p.products_id, p.products_type, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status, p.master_categories_id FROM (products p LEFT JOIN manufacturers m on (p.manufacturers_id = m.manufacturers_id), products_description pd LEFT JOIN featured f on pd.products_id = f.products_id ) WHERE p.products_status = 1 and p.products_id = f.products_id and f.status = 1 AND p.products_id = pd.products_id and pd.language_id = 1 order by pd.products_name
original_count_query=
sql_query=SELECT p.products_id, p.products_type, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status, p.master_categories_id FROM (products p LEFT JOIN manufacturers m on (p.manufacturers_id = m.manufacturers_id), products_description pd LEFT JOIN featured f on pd.products_id = f.products_id ) WHERE p.products_status = 1 and p.products_id = f.products_id and f.status = 1 AND p.products_id = pd.products_id and pd.language_id = 1 order by pd.products_name
count_query=SELECT p.products_id, p.products_type, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status, p.master_categories_id FROM (products p LEFT JOIN manufacturers m on (p.manufacturers_id = m.manufacturers_id), products_description pd LEFT JOIN featured f on pd.products_id = f.products_id ) WHERE p.products_status = 1 and p.products_id = f.products_id and f.status = 1 AND p.products_id = pd.products_id and pd.language_id = 1 order by pd.products_name
count_query=select count(*) as total FROM (products p LEFT JOIN manufacturers m on (p.manufacturers_id = m.manufacturers_id), products_description pd LEFT JOIN featured f on pd.products_id = f.products_id ) WHERE p.products_status = 1 and p.products_id = f.products_id and f.status = 1 AND p.products_id = pd.products_id and pd.language_id = 1