Solved

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

Posted on 2007-11-27
4
423 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

920 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

15 Experts available now in Live!

Get 1:1 Help Now