From: Dotan Cohen on
Take for example:
INSERT INTO table ( field ) VALUES ('{$variable}' )

Why the curly brackets? Where in the fine manual is this addressed? I
started from [1] but did not find the relevant info.

[1] http://il2.php.net/manual/en/book.mysql.php

--
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com
From: Daniel Brown on
On Wed, Jul 21, 2010 at 14:59, Dotan Cohen <dotancohen(a)gmail.com> wrote:
> Take for example:
> INSERT INTO table ( field ) VALUES ('{$variable}' )
>
> Why the curly brackets? Where in the fine manual is this addressed? I
> started from [1] but did not find the relevant info.
>
> [1] http://il2.php.net/manual/en/book.mysql.php

That's just basic variable parsing on the PHP side, it's not
MySQL-specific. Check out the "variable parsing" heading at
http://php.net/string .

--
</Daniel P. Brown>
UNADVERTISED DEDICATED SERVER SPECIALS
SAME-DAY SETUP
Just ask me what we're offering today!
daniel.brown(a)parasane.net || danbrown(a)php.net
http://www.parasane.net/ || http://www.pilotpig.net/
From: Dotan Cohen on
On Wed, Jul 21, 2010 at 22:07, Daniel Brown <danbrown(a)php.net> wrote:
>    That's just basic variable parsing on the PHP side, it's not
> MySQL-specific.  Check out the "variable parsing" heading at
> http://php.net/string .
>

Thanks, Daniel. It seems unnecessary, then, as the quote character is
not a valid character in a variable name.


--
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com
From: Nathan Nobbe on
On Wed, Jul 21, 2010 at 1:17 PM, Dotan Cohen <dotancohen(a)gmail.com> wrote:

> On Wed, Jul 21, 2010 at 22:07, Daniel Brown <danbrown(a)php.net> wrote:
> > That's just basic variable parsing on the PHP side, it's not
> > MySQL-specific. Check out the "variable parsing" heading at
> > http://php.net/string .
> >
>
> Thanks, Daniel. It seems unnecessary, then, as the quote character is
> not a valid character in a variable name.


the single quote is not part of the variable name in the example you posted
and further more the curly braces won't be evaluated as part of a variable
name unless the string expression is wrapped in double quotes (which probly
also evaluates in heredocs & nowdocs). in this case, i would say you are
right, the curly braces seem gratuitous; again as dan suggested, read the
docs for clarification ...

http://us.php.net/manual/en/language.types.string.php#language.types.string.parsing

-nathan
From: Dotan Cohen on
On Wed, Jul 21, 2010 at 22:27, Nathan Nobbe <quickshiftin(a)gmail.com> wrote:
> the single quote is not part of the variable name in the example you posted
> and further more the curly braces won't be evaluated as part of a variable
> name unless the string expression is wrapped in double quotes (which probly
> also evaluates in heredocs & nowdocs).  in this case, i would say you are
> right, the curly braces seem gratuitous; again as dan suggested, read the
> docs for clarification ...
> http://us.php.net/manual/en/language.types.string.php#language.types.string.parsing

Thanks, Nathan, I _just_finished_ reading that page!



--
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com