Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-28 Thread Jochem Maas
Larry Garfield wrote: On Saturday 27 January 2007 1:14 pm, Jochem Maas wrote: query builders are alot more fiddly to get 'right' than one might imagine, dealing with NULLs, booleans and dates for example (as Satyam pointed out) can be a right PITA. I actually almost never use native date

Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-28 Thread Satyam
- Original Message - From: Jochem Maas [EMAIL PROTECTED] To: Larry Garfield [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Sunday, January 28, 2007 12:55 PM Subject: Re: [PHP] SQL Readability.. (was Re: most powerful php editor) Larry Garfield wrote: On Saturday 27 January

Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-28 Thread Larry Garfield
On Sunday 28 January 2007 5:55 am, Jochem Maas wrote: And yes, I agree that MySQL has fairly decent date manipulation routines. But at work we do try for database independence when possible, so except on specific projects we try to avoid it. again we differ :-) I have never bought the

Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-27 Thread Satyam
- Original Message - From: Larry Garfield [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Saturday, January 27, 2007 12:18 AM Subject: Re: [PHP] SQL Readability.. (was Re: most powerful php editor) I have long since given up on raw insert/update/delete statements as the syntax

Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-27 Thread Jochem Maas
Larry Garfield wrote: I have long since given up on raw insert/update/delete statements as the syntax is all kinds nasty. These days I just do this, which is even easier and more powerful: http://www.garfieldtech.com/blog/simplifying-sql a quick look at those funcs gives me the

Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-27 Thread Robert Cummings
On Sat, 2007-01-27 at 14:43 +0100, Jochem Maas wrote: also I don't really agree with the sentiment that SQL syntax is nasty, Hear, hear :) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com |

Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-27 Thread Larry Garfield
On Saturday 27 January 2007 7:43 am, Jochem Maas wrote: Larry Garfield wrote: I have long since given up on raw insert/update/delete statements as the syntax is all kinds nasty. These days I just do this, which is even easier and more powerful:

Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-27 Thread Jochem Maas
Larry Garfield wrote: On Saturday 27 January 2007 7:43 am, Jochem Maas wrote: Larry Garfield wrote: I have long since given up on raw insert/update/delete statements as the syntax is all kinds nasty. These days I just do this, which is even easier and more powerful:

Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-27 Thread Larry Garfield
On Saturday 27 January 2007 1:14 pm, Jochem Maas wrote: query builders are alot more fiddly to get 'right' than one might imagine, dealing with NULLs, booleans and dates for example (as Satyam pointed out) can be a right PITA. I actually almost never use native date types in the SQL

[PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-26 Thread tg-php
My contribution to the insanity.. INSERT statements made easy: $genericQY = INSERT INTO MOD_LMGR_Leads (; $genericQYvalues = VALUES (; $genericQY .= FirstName,; $genericQYvalues .= 'John',; $genericQY .= LastName; $genericQYvalues .= 'Smith';

Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-26 Thread Jochem Maas
[EMAIL PROTECTED] wrote: My contribution to the insanity.. INSERT statements made easy: can't stand long var names if they're not absolutely necessary (JMO). although I follow TG's logic here I don't find it that readable, too many dots, [double]quotes, etc for my taste. $genericQY =

Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-26 Thread Stut
[EMAIL PROTECTED] wrote: My contribution to the insanity.. INSERT statements made easy: $genericQY = INSERT INTO MOD_LMGR_Leads (; $genericQYvalues = VALUES (; $genericQY .= FirstName,; $genericQYvalues .= 'John',; $genericQY .= LastName;

Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-26 Thread Jon Anderson
This may not be an option for many people, 'cause ISPs and web hosts may not be forward-thinking enough to install PDO or recent PHP, but... PDO can do do this in a very database independant way, without having to do the equivalent of mysql_real_escape_string: $table = 'xyz'; $data = array(

Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-26 Thread Jochem Maas
Jon Anderson wrote: This may not be an option for many people, 'cause ISPs and web hosts may not be forward-thinking enough to install PDO or recent PHP, but... PDO can do do this in a very database independant way, without having to do the equivalent of mysql_real_escape_string: $table =

Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-26 Thread tg-php
Strangely enough, Stut and Jochem, I DO find this more readable. Hah. I know, I'm insane. I have done it the way you guys proposed, using an associative array and using the keys and values as the columns and insert values. While that is what I'd call tighter code and when you understand what

Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-26 Thread Satyam
- Original Message - From: Stut [EMAIL PROTECTED] You call that readable?? $vals = array(); $vals['FirstName'] = 'John'; $vals['LastName'] = 'Smith'; $query = mysql_query(BuildInsert('MOD_LMGR_Leads', $vals)); function BuildInsert($table, $values) { foreach (array_keys($values) as

Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-26 Thread Robert Cummings
On Fri, 2007-01-26 at 16:30 +, Stut wrote: [EMAIL PROTECTED] wrote: My contribution to the insanity.. INSERT statements made easy: $genericQY = INSERT INTO MOD_LMGR_Leads (; $genericQYvalues = VALUES (; $genericQY .= FirstName,; $genericQYvalues .=

Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-26 Thread Robert Cummings
On Fri, 2007-01-26 at 12:25 -0500, [EMAIL PROTECTED] wrote: Strangely enough, Stut and Jochem, I DO find this more readable. Hah. I know, I'm insane. I have done it the way you guys proposed, using an associative array and using the keys and values as the columns and insert values. While

Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-26 Thread Larry Garfield
I have long since given up on raw insert/update/delete statements as the syntax is all kinds nasty. These days I just do this, which is even easier and more powerful: http://www.garfieldtech.com/blog/simplifying-sql On Friday 26 January 2007 10:03 am, [EMAIL PROTECTED] wrote: My contribution