On Wed, May 2, 2007 10:42 am, Rahul S. Johari wrote:
> Here¹s the thing, I¹ve got an Array which has it¹s own set of Keys =>
> Values. I¹m using foreach() to read the Keys => Values like this:
>
//note added arguments!
> function pr1($var, $var2, $var3) {
> foreach ($var as $k => $
On Wed, May 2, 2007 11:03 am, Jim Moseby wrote:
>>
>> $sql = "INSERT INTO table (f1, f2, f3, ". implode(",",
>> array_keys($pr1)) .")
>>VALUES ('abc', '123', '456', ". implode(",",
>> array_values($pr1))
>> .")";
>>
>> HTH,
>>
>> Brad
>
>
> Might not work if the array values need to be en
WORKS Like A Charm!! :)
Thanks.
On 5/2/07 12:14 PM, "Brad Fuller" <[EMAIL PROTECTED]> wrote:
> Jim Moseby wrote:
>>> $sql = "INSERT INTO table (f1, f2, f3, ". implode(",",
>>> array_keys($pr1)) .") VALUES ('abc', '123', '456', ". implode(",",
>>> array_values($pr1))
>>> .")";
>>>
>>> HTH,
>>
Jim Moseby wrote:
>> $sql = "INSERT INTO table (f1, f2, f3, ". implode(",",
>>array_keys($pr1)) .") VALUES ('abc', '123', '456', ". implode(",",
>> array_values($pr1))
>> .")";
>>
>> HTH,
>>
>> Brad
>
>
> Might not work if the array values need to be enclosed in
> quotes. I would build
Ave,
I was just about to post when I saw your message. I think what you're saying
is exactly what is happening. The values have Spaces and stuff so Quotes are
Required - cannot have values not enclosed in Quotes. Other then that it was
actually working.
Is there a way to enclose in Quotes using
>
> $sql = "INSERT INTO table (f1, f2, f3, ". implode(",",
> array_keys($pr1)) .")
> VALUES ('abc', '123', '456', ". implode(",",
> array_values($pr1))
> .")";
>
> HTH,
>
> Brad
Might not work if the array values need to be enclosed in quotes. I would
build the query string in a for
On 5/2/07, Rahul S. Johari <[EMAIL PROTECTED]> wrote:
Ave,
Here¹s the thing, I¹ve got an Array which has it¹s own set of Keys =>
Values. I¹m using foreach() to read the Keys => Values like this:
function pr1($var) {
foreach ($var as $k => $v) {
echo ³$k => $v²;
Rahul S. Johari wrote:
> Ave,
>
> Here¹s the thing, I¹ve got an Array which has it¹s own set of
> Keys => Values. I¹m using foreach() to read the Keys => Values like
> this:
>
> function pr1($var) {
> foreach ($var as $k => $v) {
> echo ³$k => $v²;
> }
>
Ave,
Here¹s the thing, I¹ve got an Array which has it¹s own set of Keys =>
Values. I¹m using foreach() to read the Keys => Values like this:
function pr1($var) {
foreach ($var as $k => $v) {
echo ³$k => $v²;
}
I need to INSERT the Values from this a
9 matches
Mail list logo