Solved

1054 - Unknown column 'm.manufacturers_name' in 'where clause'

Posted on 2007-11-27
4
422 Views
Last Modified: 2012-08-13
What would be the best way to troubleshoot this error:

1054 - Unknown column 'm.manufacturers_name' in 'where clause'

select count(distinct p.products_id) as total from products p left join specials s on p.products_id = s.products_id, products_description pd, categories c, products_to_categories p2c where p.products_status = '1' and c.categories_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((pd.products_name like '%solar%' or p.products_model like '%solar%' or m.manufacturers_name like '%solar%') )

Thanks
0
Comment
Question by:dpaule
  • 2
4 Comments
 
LVL 20

Accepted Solution

by:
steelseth12 earned 500 total points
ID: 20357114
Break up your conditions so they are easier to read.
In this case you can see that you dont have a table alias m
You only have

products p and

specials s



select count(distinct p.products_id) as total from
products p left join
specials s
on p.products_id = s.products_id, products_description pd, categories c, products_to_categories p2c where p.products_status = '1'
and c.categories_status = '1'
and p.products_id = pd.products_id
and pd.language_id = '1'
and p.products_id = p2c.products_id
and p2c.categories_id = c.categories_id
and ((pd.products_name like '%solar%'
or p.products_model like '%solar%' or m.manufacturers_name like '%solar%') )
0
 
LVL 23

Expert Comment

by:Ashish Patel
ID: 20357137
select count(distinct p.products_id) as total from products p left join specials s on p.products_id = s.products_id, products_description pd, categories c, products_to_categories p2c where p.products_status = '1' and c.categories_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((pd.products_name like '%solar%' or p.products_model like '%solar%' or p.manufacturers_name like '%solar%') )
0
 

Author Closing Comment

by:dpaule
ID: 31411174
I removed any reference to m.manufacturers_name since I didn't need to search in the manufacturers table.
0
 

Author Comment

by:dpaule
ID: 20357475
I removed any reference to m.manufacturers_name since I didn't need to search in the manufacturers table.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now