Re: SQL Readability.. (was Re: most powerful php editor)
| From: | Robert Cummings | Date: | Fri, 26 Jan 2007 18:28:04 +0000 |
| Subject: | Re: SQL Readability.. (was Re: most powerful php editor) | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-247845@lists.php.net to get a copy of this message | ||
On Fri, 2007-01-26 at 16:30 +0000, Stut wrote:
> tg-php@gryffyndevelopment.com wrote:
> > 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'";
> > $genericQY .= " )"; $genericQYvalues .= "
> > );";
> > $genericQY .= $genericQYvalues;
> > $genericRS = mysql_query($genericQY);
>
> You call that readable??
>
> $vals = array();
> $vals['FirstName'] = 'John';
> $vals['LastName'] = 'Smith';
> $query = mysql_query(BuildInsert('MOD_LMGR_Leads', $vals));
Geee, you call that readable???
$vals = array
(
'FirstName' => 'John',
'LastName' => 'Smith',
);
$query = mysql_query( BuildInsert( 'MOD_LMGR_Leads', $vals ) );
;) ;)
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com
|
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'