Re: [PHP] Queries and Common Practices

2011-05-22 Thread Dotan Cohen
On Sun, May 22, 2011 at 17:38, tedd wrote: > SELECT p.id, p.name, a.total FROM people p, accounts.a WHERE gender = 'male' > Finding the error in the above code is fun. I'm surprised I spotted, it shows how sensitive one gets to debugging. For that matter, I like the OP's practice of redundancy i

Re: [PHP] Queries and Common Practices

2011-05-22 Thread tedd
At 10:50 AM +0100 5/22/11, Ashley Sheridan wrote: -snip- but I also give the table a moniker which lets me shorten the queries as I type: SELECT p.id, p.name FROM people p WHERE p.gender = 'male' This way, I can easily join in other tables, my typing is kept to a minimum as I do it also. A

Re: [PHP] Queries and Common Practices

2011-05-22 Thread Richard Quadling
On 22 May 2011 10:50, Ashley Sheridan wrote: > On Sun, 2011-05-22 at 05:33 -0400, ad...@buskirkgraphics.com wrote: > >> I have been working on a class methods for some time now. >> >> >> >> I have reached a cross road when it comes to common practice of developing >> query structure. >> >> >> >> L

Re: [PHP] Queries and Common Practices

2011-05-22 Thread Ashley Sheridan
On Sun, 2011-05-22 at 05:33 -0400, ad...@buskirkgraphics.com wrote: > I have been working on a class methods for some time now. > > > > I have reached a cross road when it comes to common practice of developing > query structure. > > > > Long ago I wrote queries where I just called the fi

[PHP] Queries and Common Practices

2011-05-22 Thread admin
I have been working on a class methods for some time now. I have reached a cross road when it comes to common practice of developing query structure. Long ago I wrote queries where I just called the field I wanted on a particular table unless I was joining them. Example: $query = " SE