Re: new keyword combined with other things...
| From: | Paul M Foster | Date: | Wed, 08 Dec 2010 17:31:28 +0000 |
| Subject: | Re: new keyword combined with other things... | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-309910@lists.php.net to get a copy of this message | ||
On Wed, Dec 08, 2010 at 07:14:39AM -0800, Tommy Pham wrote:
> On Tue, Dec 7, 2010 at 1:55 PM, Paul M Foster <paulf@quillandmouse.com>
> wrote:
> >
> >
> > $this->db->select('title')->from('mytable')->where('id',
> > $id)->limit(10,
> > 20);
> >
> > What kind of internal magic they use to make this work, I don't know. I
> > haven't examined their internals.
> >
> > Paul
> >
> > --
> > Paul M. Foster
> >
>
> I've never seen the code nor used CodeIgniter but it might be
> something like this:
[snip]
>
> The only need I see for this is to build the query dynamically...
> which should be very rare since all those function calls are
> expensive, IMO.
I agree. My advice for SQL is always to learn SQL rather than use a
bunch of active record functionality. But I'm sure people think I'm just
a curmudgeonly old turd. ;-}
Paul
--
Paul M. Foster