Re: Quotes in querys
| From: | Kyle Terry | Date: | Wed, 14 Jan 2009 16:58:38 +0000 |
| Subject: | Re: Quotes in querys | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-286328@lists.php.net to get a copy of this message | ||
On Wed, Jan 14, 2009 at 8:41 AM, MikeP <mpeloso@princeton.edu> wrote:
> Thanks, Thats the kind of help I was looking for.
> Mike
> <ceo@l-i-e.com> wrote in message
> news:20090114162142.65944.qmail@o2.hostbaby.com...
> >
> > You can only interpolate ONE level of array or object indirection in a
> > string.
> >
> > WORKS:
> > "... $foo[x] ..."
> > "... $foo->x ..."
> >
> > FAILS:
> > "... $foo[x][y] ..."
> > "... $foo->x->y ..." //almost for sure it fails, never tried...
> >
> > You can use curly braces in side a string to evaluate something:
> >
> > WORKS:
> > "... {$foo[x][y]} ..."
> > "... {$foo->x->y} ..."
> >
> > [soapbox]
> > I personally think this is possibly the ugliest wart of variable/string
> > interpolation.
> >
> > Not sure how/why it came about, but it makes zero sense, really...
> > [/soapbox]
> >
> > ymmv
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Doesn't anybody use prepared statements these days? It even helps MySQL AND
Oracle cache an execution plan...
--
Kyle Terry | www.kyleterry.com