On Thursday 23 October 2003 02:41, Jeff McKeon wrote:
> I looked at the page you suggested but it vauge at best. Basically from
> what I've gathered using serialize with an array screws up the pointers
> in the array. Is this true?
If you mean the internal pointer, ie the one that is reset by calling reset(),
then who cares. Keeping that pointer across pages has little/no value. What
is important is that the structure and values of the array is intact.
> What I've done is this but it doesn't seem to be working...
>
> Pull data (two fields) from a mysql table and put the results into two
> arrays, one for each field
>
> Query results for field 1 -> Array1[]
> Query results for field 2 -> Array2[]
>
> Then I create a variable with the imploded data from the arrays
>
> $var1=implode(":", $Array1);
> $var2=implode(":", $Array2);
>
> Then serialize the variables...
>
> $varSER1=serialize($var1);
> $varSER2=serialize($var2);
AFAICS serialize() on a string seems to be redundant. serialize() is supposed
to represent some complex entity (eg an array) as a string so it can be
easily stored, transmitted etc.
So something like:
$var_to_pass_in_url = urlencode(serialize($Array1));
Then construct your url like so:
http://www.example.com/example.php?Array1=$var_to_pass_in_url
Then in example.php you reconstruct the array:
$Array1 = unserialize($_GET['Array1']);
ought to work (but untested).
> Then pass the variables in the url via a GET.
>
> It doesn't work however....
*How* doesn't *What* work?
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
The opposite of a correct statement is a false statement. But the opposite
of a profound truth may well be another profound truth.
-- Niels Bohr
*/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php