RE: i'm beginner and i couldn't solve the problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chris W. Parker wrote:
> Ford, Mike <mailto:M.Ford@xxxxxxxxxxxxxx>
>     on Wednesday, December 08, 2004 5:18 AM said:
>
>>> $sql = "INSERT INTO testTable values ('', '$_POST[testField]')";
>>>
>>> should be
>>>
>>> $var = $_POST["testField"];
>>> $sql = "INSERT INTO testTable values ('', '$var')";
>>
>> Nope -- the original is functionally identical to your suggested
>> correction.
>
> Hmm... I thought arrays don't work correctly within a string unless they
> are wrapped with { and }?

That is a misconception on your part.  Read the manual.  It's quite clear
and concise.

http://www.php.net/manual/en/language.types.string.php

Arrays of MORE THAN ONE DIMENSION will need { and }

One-dimension arrays work just fine without.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux