[thelist] MySQL oddness

Dan Parry dan at virtuawebtech.co.uk
Tue Jan 29 22:42:05 CST 2008


> your "dodgy" sql is the problem, and will cause an error in version 5
> which has stricter rules about evaluating joins

Also my dodgy reading skills are called into question... It was actually
5.0.12... Oops *ahem*

> double-check your target server's version, because the dodgy sql should
actually work on 4.1.22
> 
> you know how ANDs take precedence over ORs in compound conditions?

I do

> mixing JOIN syntax with the old "comma-separated table list" syntax is
like that
> 
> you have
> 
>     FROM snip_map_request `mr`
>         , snip_course_details `c`
>      INNER JOIN snip_course_details
>           ON `c`.`id` = `mr`.`course_id`
> 
> notice where the comma is
> 
> this means that the following is parsed first --
> 
>          snip_course_details `c`
>      INNER JOIN snip_course_details
>           ON `c`.`id` = `mr`.`course_id`
> 
> and of course at this point you get the error about mr.course_id being
> unknown

Now that I didn't realise... I understand now... thanks

> solution? rewrite all your joins so as not to use the (deprecated) old
> "comma-separated table list" syntax

In a sort of defence I'm really not sure why I wrote the queries in that
way... I suppose all I can say is live and learn... Your comments have
really helped to clarify some points for me and I've decided to go back to
basics for edification :)

Cheers!

> rudy
> http://r937.com/
> 
> 
> 
> --
> 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
> 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.516 / Virus Database: 269.19.15/1248 - Release Date:
> 28/01/2008 21:32
> 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.19.15/1248 - Release Date: 28/01/2008
21:32
 




More information about the thelist mailing list