[PHP] question about best practice for coding sql statements

2011-11-12 Thread tamouse mailing lists
I'm curious how others feel about this. When I'm creating an SQL string, either for a non-prepared or prepared execution, I build it in a variable and then pass the variable to the query or prepare function. This lets me easily add something to view the SQL statement, and also if there's an error,

Re: [PHP] question about best practice for coding sql statements

2011-11-12 Thread Stephen
On 11-11-12 06:30 AM, tamouse mailing lists wrote: I'm curious how others feel about this. When I'm creating an SQL string, either for a non-prepared or prepared execution, I build it in a variable and then pass the variable to the query or prepare function. This lets me easily add something to

Re: [PHP] question about best practice for coding sql statements

2011-11-12 Thread Geoff Shang
On Sat, 12 Nov 2011, tamouse mailing lists wrote: I'm curious how others feel about this. When I'm creating an SQL string, either for a non-prepared or prepared execution, I build it in a variable and then pass the variable to the query or prepare function. This lets me easily add something to

Re: [PHP] question about best practice for coding sql statements

2011-11-12 Thread tamouse mailing lists
On Sat, Nov 12, 2011 at 7:01 AM, Stephen stephe...@rogers.com wrote: While I am not a big fan of OOP, I do like PDO, and recommend its use. Right -- I wasn't actually inquiring about how to access a data base, merely the pactice of using a variable for the SQL -- In your example, you are doing