
12-30-2004, 09:22 PM
|
|
Junior Guru
|
|
Join Date: Feb 2004
Posts: 206
|
|
what is wrong with this?
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
I get an error here
http://lexishosting.com/osc_new/index.php?cPath=1_17
__________________
Thanks, Kevin
|

12-30-2004, 10:06 PM
|
|
Junior Guru Wannabe
|
|
Join Date: Dec 2004
Posts: 78
|
|
Your query looks the same as mine. The syntax problem may be somewhere else in index.php, though. Have you tried restoring your original index.php to see if the error goes away? If it does, try to find the error by using WinMerge (winmerge.sourceforge.net) to compare your modified file to the original one.
(FWIW, this would be a good question for the osC forum.)
-jared
|

12-30-2004, 10:28 PM
|
|
WHT Addict
|
|
Join Date: Nov 2004
Location: Santa Clara, CA
Posts: 124
|
|
Quote:
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 'select p.products_image, pd.products_name, p.products_id, p.ma
select count(select p.products_image, pd.products_name, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = \'1\' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = \'1\' and p2c.categories_id = \'17\' order by pd.products_name) as total
|
Ok, I've never seen a subselect in a COUNT before in ANY dialect of SQL so I'm going to guess that's your first problem.
Second, even if MySQL does support that, what version of MySQL are you using. Subselectes are supported until version 4.1. (I do believe, somebody correct me if I'm wrong.)
I'd re-think the select statement.
=C=
__________________
[url=http://www.calevans.com[/url]
|

12-30-2004, 10:33 PM
|
|
Junior Guru
|
|
Join Date: Feb 2004
Posts: 206
|
|
well this comes straight from osc original code. has always worked before but now I have changed so much that I don't know what is causing it. I guess I'll just have to start over. Oh well.
Thanks anyhow.
__________________
Thanks, Kevin
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
| Postbit Selector |
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
| Login: |
|
|
| Advertisement: |
|
|
| Web Hosting News: |
|
|
|