Re: [PHP] What are the curly brackets around variables in SQL statements for?
On Wed, Jul 21, 2010 at 15:27, Nathan Nobbe wrote: > [snip!] > name unless the string expression is wrapped in double quotes (which probly > also evaluates in heredocs & nowdocs). [snip!] Close. HEREDOC, yes. NOWDOC, no. There's zero parsing done on NOWDOC strings. -- UNADVERTISED DEDICATED SERVER SPECIALS SAME-DAY SETUP Just ask me what we're offering today! daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What are the curly brackets around variables in SQL statements for?
On Wed, Jul 21, 2010 at 1:32 PM, Daniel Brown wrote: > On Wed, Jul 21, 2010 at 15:27, Nathan Nobbe > wrote: > > > [snip!] > > name unless the string expression is wrapped in double quotes (which > probly > > also evaluates in heredocs & nowdocs). > [snip!] > >Close. HEREDOC, yes. NOWDOC, no. There's zero parsing done on > NOWDOC strings. word. -nathan
Re: [PHP] What are the curly brackets around variables in SQL statements for?
On Wed, Jul 21, 2010 at 22:27, Nathan Nobbe 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What are the curly brackets around variables in SQL statements for?
On Wed, Jul 21, 2010 at 1:17 PM, Dotan Cohen wrote: > On Wed, Jul 21, 2010 at 22:07, Daniel Brown 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
Re: [PHP] What are the curly brackets around variables in SQL statements for?
On Wed, Jul 21, 2010 at 22:07, Daniel Brown 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What are the curly brackets around variables in SQL statements for?
On Wed, Jul 21, 2010 at 14:59, Dotan Cohen 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 . -- UNADVERTISED DEDICATED SERVER SPECIALS SAME-DAY SETUP Just ask me what we're offering today! daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] What are the curly brackets around variables in SQL statements for?
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php