thebearmillonline Posted December 3, 2006 Posted December 3, 2006 I am trying to finish our online store, and I get this error message. I don't know much about SQL, so please help if you can: 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 'products_description pd left join manufacturers m on p.manufactu select count(p.products_id) as total from products p products_description pd 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 = '23' [TEP STOP] Thanks, Sean
Possum Blossom Posted December 6, 2006 Posted December 6, 2006 Hi Sean, I am brand new at all this, but I have learnt a few things by trail and error over the past 6 weeks. I had a similar problem to this and figured out that it was basically a typing error in the code. I'm sure other people will be able to quickly identify the problem, but here is some basic information that might help you. Most of this code uses abbreviations so that the table names don't need to be written in full each time. For example: "products p" means "the abbreviation for the products table is p" "products_description pd" means "the "the abbreviation for the products_description table is pd" "products_to_categories p2c" means "the abbreviation for the products_to_categories table is p2c" and similarly for "specials s" and "manufacturers m". I'm not exactly sure how to explain "left join", but it means something about how the data from one table is joined to another. "p.products_id = s.products_id" means "where the data in the products_id field in the products table equals the data in the products_id field in the specials table" "p.products_id = p2c.products_id" means "where the data in the products_id field in the products table equals the data in the products_id field in the products_to_categories table" While I can't figure out your exact error, I can tell you that once I figured out the above, I was able to logically work out that the problem in my error code was that in one place they should have written "p2c.products_id" instead of "p.products_id". I'm not saying that this is the error in your case, I just wanted to explain one sort of error that you could get when the error is 1064. I hope someone else can quickly identify the exact error for you. jo
Recommended Posts
Archived
This topic is now archived and is closed to further replies.