List:General Discussion« Previous MessageNext Message »
From:Peter Brawley Date:January 24 2006 9:35pm
Subject:Re: Query Help
View as plain text  
Ian,

>It now looks like this and still doesn't work, complains about exactly the
>same thing.

>SELECT c.*, g.name AS groupname, cc.name, u.name AS editor, f.content_id AS
>frontpage, s.title AS section_name, v.name AS author FROM mos_content c,
>mos_categories cc, mos_sections s INNER JOIN mos_groups g ON (g.id =
>c.access) INNER JOIN mos_users u ON (u.id = c.checked_out) INNER JOIN
>mos_users v ON (v.id = c.created_by) INNER JOIN mos_content_frontpage f ON
>(f.content_id = c.id) WHERE c.state >= 0 AND c.catid=cc.id AND
>cc.section=s.id AND s.scope='content' AND c.sectionid='1' ORDER BY
>cc.ordering, cc.title, c.ordering LIMIT 0,10;

Your query still has a comma join.

PB

-----

Ian Barnes wrote:
> Hi,
>
> It now looks like this and still doesn't work, complains about exactly the
> same thing.
>
> SELECT c.*, g.name AS groupname, cc.name, u.name AS editor, f.content_id AS
> frontpage, s.title AS section_name, v.name AS author FROM mos_content c,
> mos_categories cc, mos_sections s INNER JOIN mos_groups g ON (g.id =
> c.access) INNER JOIN mos_users u ON (u.id = c.checked_out) INNER JOIN
> mos_users v ON (v.id = c.created_by) INNER JOIN mos_content_frontpage f ON
> (f.content_id = c.id) WHERE c.state >= 0 AND c.catid=cc.id AND
> cc.section=s.id AND s.scope='content' AND c.sectionid='1' ORDER BY
> cc.ordering, cc.title, c.ordering LIMIT 0,10;
>
> Thanks,
> Ian
>
> -----Original Message-----
> From: gerald_clark [mailto:gerald_clark@stripped] 
> Sent: 24 January 2006 09:50 PM
> To: Ian Barnes
> Cc: mysql@stripped
> Subject: Re: Query Help
>
> Ian Barnes wrote:
>
>   
>> Hi,
>>
>> This is my current query which works in mysql 4, but not in 5. Its from
>> mambo, but im trying to modify it because they don't officially support
>> mysql5 yet.
>>
>> The original query:
>> SELECT c.*, g.name AS groupname, cc.name, u.name AS editor, f.content_id AS
>> frontpage, s.title AS section_name, v.name AS author FROM mos_content AS c,
>> mos_categories AS cc, mos_sections AS s LEFT JOIN mos_groups AS g ON g.id =
>> c.access LEFT JOIN mos_users AS u ON u.id = c.checked_out LEFT JOIN
>> mos_users AS v ON v.id = c.created_by LEFT JOIN mos_content_frontpage AS f
>> ON f.content_id = c.id WHERE c.state >= 0 AND c.catid=cc.id AND
>> cc.section=s.id AND s.scope='content' AND c.sectionid='1' ORDER BY
>> cc.ordering, cc.title, c.ordering LIMIT 0,10
>>
>> My modified version:
>> SELECT c.*, g.name AS groupname, cc.name, u.name AS editor, f.content_id AS
>> frontpage, s.title AS section_name, v.name AS author FROM mos_content c,
>> mos_categories cc, mos_sections s INNER JOIN mos_groups g ON (g.id =
>> c.access) LEFT JOIN mos_users u ON (u.id = c.checked_out) LEFT JOIN
>> mos_users v ON (v.id = c.created_by) LEFT JOIN mos_content_frontpage f ON
>> (f.content_id = c.id) WHERE c.state >= 0 AND c.catid=cc.id AND
>> cc.section=s.id AND s.scope='content' AND c.sectionid='1' ORDER BY
>> cc.ordering, cc.title, c.ordering LIMIT 0,10;
>>
>> The error I get for both ones is: Unknown column 'c.access' in 'on clause'
>>
>> Thanks and sorry for the stupid question.
>>
>> Cheers
>> Ian
>>
>>
>>
>>  
>>
>>     
> Replace all your comma joins to INNER JOIN syntax
>
>   

Attachment: [text/html]
No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.14.22/238 - Release Date: 1/23/2006
Thread
Query HelpIan Barnes24 Jan
  • Re: Query Helpgerald_clark24 Jan
    • RE: Query HelpIan Barnes24 Jan
      • RE: Query HelpSGreen24 Jan
      • Re: Query HelpPeter Brawley24 Jan