hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : mysql error
Reply

Hosting Security and Technology Configuring and optimizing web hosting servers and operating systems, developing administration scripts, building servers, protecting against hackers, and general security (SSL certificates, etc.)
Forum Jump

mysql error

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 12-30-2004, 09:22 PM
lexis2004 lexis2004 is offline
Junior Guru
 
Join Date: Feb 2004
Posts: 206

mysql error


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

Reply With Quote


Sponsored Links
  #2  
Old 12-30-2004, 10:06 PM
jcall jcall is offline
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

Reply With Quote
  #3  
Old 12-30-2004, 10:28 PM
OxnardMontalvo OxnardMontalvo is offline
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]

Reply With Quote
Sponsored Links
  #4  
Old 12-30-2004, 10:33 PM
lexis2004 lexis2004 is offline
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

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Web Host Rackspace Launches Private Beta for MySQL Cloud Database Web Hosting News 2011-12-01 21:09:51
Parallels Now Offering Licenses for CloudLinux OS Web Hosting News 2011-10-26 17:29:25
Web Hosting Sales and Promos Roundup - October 7, 2011 Web Hosting News 2011-10-07 19:56:18
Web Hosting Software Firm CloudLinux Releases CloudLinux OS Version 6.1 Web Hosting News 2011-09-13 14:08:49
Web Host FireHost Partners with Cloud Security Firm Gazzang for Data Encryption Web Hosting News 2011-08-16 20:33:43


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?