The reason curly braces are needed are because you are putting an array
element into a string. Consider..
$sBlah = 'blah';
echo "$sBlahfoo$sBlahfoo";
PHP will attempt to echo the variable $sBlahfoo twice. if you use
echo "{$sBlah}foo{$sBlah}foo";
you have told php explicitly when to look for
On Sun, Oct 19, 2003 at 02:51:33PM -0400, Adam Reiswig wrote:
:
: A couple of days ago I placed a post regarding using the $_POST[]
: variable in an insert sql query. Both
:
: $sql="insert into $table set Name = '".$_POST['elementName']."'";
: and
: $sql="insert into $table set Name = '{$_POS
> "Adam" == Adam Reiswig <[EMAIL PROTECTED]> writes:
Adam> A couple of days ago I placed a post regarding using the
Adam> $_POST[] variable in an insert sql query. Both
Adam> $sql="insert into $table set Name =
Adam> '".$_POST['elementName']."'"; and $sql="insert into $table
Adam Reiswig wrote:
My question now is
regarding the curly brackets in the 2nd example. Can anyone describe
why using the curly brackets works and/or how php processes them. I
have read quite a bit about php and never come accross thier use in this
way. Thanks again.
http://us2.php.net/manual/e
A couple of days ago I placed a post regarding using the $_POST[]
variable in an insert sql query. Both
$sql="insert into $table set Name = '".$_POST['elementName']."'";
and
$sql="insert into $table set Name = '{$_POST['elementName']}'";
worked perfectly. Thanks to everyone for your help. My
On Thu, 16 Oct 2003, Adam Reiswig wrote:
> $sql="insert into $table set Name = '$_POST["elementName"]'";
>
> Unfortunately this and every other combination I can think of,
> combinations of quotes that is, does not work. I believe the source of
> the problem is the quotes within quotes within quo
6 matches
Mail list logo