Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't find table error, even though table exists

Status
Not open for further replies.

LeonKl2

Programmer
Jun 16, 2003
26
US
I use the following query:

SELECT * from ads where user!='$id' and ready=1 and category='$category' and main.id=user and main.credits>4;

And it returns #1109 - Unknown table 'main' in where clause

But the "main" table exists. What gives?
I've tried it with other tables in the same database and it says that they all don't exist.

Any ideas?

Thanks
 
Um,

either you have to include the main table in the FROM clause and then Join the tables, or you shouldn't be utilizing main.anything in the SELECT statement.

The only table you're specifying the Statement to operate on is the 'ads' table.

*cLFlaVA
----------------------------
A polar bear walks into a bar and says, "Can I have a ... beer?"
The bartender asks, "What's with the big pause?
 
Thanks, adding main the from clause worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top