I'm in the middle of porting an application I've written from Cold
Fusion/MS-SQL server on NT to PHP/MySQL on FreeBSD. (MySQL v.3.22.27)
I've ran into a little hitch I can't get around. I have this query
that looks like this:
FROM (main INNER JOIN s_housing ON main.id = s_housing.id)
INNER JOIN type ON main.type_id = type.type_id
WHERE s_housing.approval = 'YES' AND main.type_id != 4
ORDER BY title, type
It works fine in MS-SQL server. In MySQL it chokes on the Inner Joins.
I get a syntax error. I've searched and searched, but I can't find any
info on how to "convert" this query so it works in MySQL.
In the MySQL manual, all I could find about inner joins is this one
"INNER JOIN and , (comma) are semantically equivalent. Both do a full
join between the tables used. Normally, you specify how the tables
should be linked in the WHERE condition."
I've never seen the ON operator used in a WHERE clause before. I'm not
saying you can't, I've just never seen that syntax. I just need to see an
example of a 3 table inner join, so I know how to modify my queries
Any help anyone can give me would be greatly appreciated...
tel: 416.596.0212 x13 fax: 416.596.1374
Internet Solutions for People Not for Profit
http://www.web.net ---- http://community.web.net