pg.ddx.io pgsql-php@postgresql.org mailing list archive
help / color / mirror / Atom feedArrays and PHP 4.2
3+ messages / 3 participants
[nested] [flat]
* Arrays and PHP 4.2
@ 2002-11-10 16:50 Kelvin Varst <kelvin@varst.dk>
0 siblings, 0 replies; 3+ messages in thread
From: Kelvin Varst @ 2002-11-10 16:50 UTC (permalink / raw)
To: pgsql-php
Hi,
I have an old site that I upgrade to PHP 4.2, with the new way of tranfering
variables to the next page. It all almost works them i replace $id with
$_GET[id]. But on one page I use an array (new[]), and that worked ok, like:
In a for-loop
print "<td><input type=\"text\" name=\"new[$col_count]\" value=\"" .
$data->$temp . "\" size=\"64\" maxlength=\"" . $name->kolonne_bredde . "\"
/></td>";
then I send the array new[] to the next page, and access the data like:
In a for-loop
$temp = $temp . ", {$names[$n]} = '" . $new[$n] . "'";
wich is building a string to a Postgres query, then it worked on PHP 4.1. I
have changed the line to:
$temp = $temp . ", {$names[$n]} = '" . $_GET[new[$n]] . "'";
wich is not working. What am I doing wrong, it is only a problem on the
array, single variables works.
Kelvin :-)
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Arrays and PHP 4.2
@ 2002-11-10 18:42 Cornelia Boenigk <poppcorn@cornelia-boenigk.de>
0 siblings, 0 replies; 3+ messages in thread
From: Cornelia Boenigk @ 2002-11-10 18:42 UTC (permalink / raw)
To: Kelvin Varst <kelvin@varst.dk>; pgsql-php
Hi Kelvin
You should serialize the Array then you can send it as string.
See the php-documentation for
serialize()
unserialize()
regards
Conni
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Arrays and PHP 4.2
@ 2002-11-10 22:42 Andrew McMillan <andrew@catalyst.net.nz>
0 siblings, 0 replies; 3+ messages in thread
From: Andrew McMillan @ 2002-11-10 22:42 UTC (permalink / raw)
To: Kelvin Varst <kelvin@varst.dk>; +Cc: pgsql-php
On Mon, 2002-11-11 at 05:50, Kelvin Varst wrote:
> Hi,
>
> wich is building a string to a Postgres query, then it worked on PHP 4.1. I
> have changed the line to:
>
> $temp = $temp . ", {$names[$n]} = '" . $_GET[new[$n]] . "'";
>
> wich is not working. What am I doing wrong, it is only a problem on the
> array, single variables works.
Shouldn't that be:
$temp = $temp . ", {$names[$n]} = '" . $_GET[new][$n] . "'";
The array is still there, it's just that it is now a sub-dimension of
another array.
Regards,
Andrew.
--
---------------------------------------------------------------------
Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington
WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St
DDI: +64(4)916-7201 MOB: +64(21)635-694 OFFICE: +64(4)499-2267
Survey for nothing with http://survey.net.nz/
---------------------------------------------------------------------
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2002-11-10 22:42 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-11-10 16:50 Arrays and PHP 4.2 Kelvin Varst <kelvin@varst.dk>
2002-11-10 18:42 Re: Arrays and PHP 4.2 Cornelia Boenigk <poppcorn@cornelia-boenigk.de>
2002-11-10 22:42 Re: Arrays and PHP 4.2 Andrew McMillan <andrew@catalyst.net.nz>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox