Veerapuram Satakopan wrote:
> 
> Respected Sir,
> 
> I am working as a System Analyst for Topworld Inftech, India.  We are using 
>php-mysql for our web based projects.  I found a problem while i am using the 
>following Query.
> 
> SQL-query:
> 
> select distinctrow c.name, p.cat_id, p.prd_id, p.name, p.description, p.title, 
>p.price
> from categories c inner join(products p left join(products a
> left join products b on a.prd_id = b.prd_id)on p.prd_id = a.prd_id)
> on c.cat_id = p.cat_id where lower(p.name) like lower('%a%') or
> lower(a.title) like lower('%a%') or lower(b.description)
> like lower('%a%');
> 
> Error
> You have an error in your SQL syntax near 'inner join(products p left join(products 
>a left join products b on a.prd_id = ' at line 2
> 
> Can u tell me how to solve this problem.  Waiting eagerly for your reply.
> 
> With Regards,
> 
> V.Satakopan,
> System Analyst,
> Topworld Inftech,
> No.1, Santhome High Road,
> Chennai - 600 004,
> Tamil Nadu,
> India.

Veerapuram:

What's the possibility you could set your clock correctly?

We appear to be in the year 2001, although that probably has little to do with
the issue you've reported.

Inner join requires the ON keyword:

> from categories c inner join(products p left join(products a


If the above could possibly work, it would have to be:
from categories c inner join on products p left join(products a...

You might have some other issues with your query.

It's typically more useful to capitalize reserved words and Ucase query terms.  

Recommendation:
SELECT ThisField, ThatField
FROM ThisTable
ORDER BY SomeArbitraryField;

Less useful:
select thisfield, thatfield
fromt hisfield
order by somearbitraryfield;

Perhaps the difference between the above 2 statements makes it obvious.  Or,
perhaps you didn't note the deliberate mistake. 

MySQL will honor capitalization in it's error messages.  

Possible self-help remedies might be found at:
http://www.mysql.com/doc/J/O/JOIN.html

Regards,
Van
-- 
=================================================================
Linux rocks!!!   http://www.dedserius.com/
=================================================================

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to