My first idea is something like this:

$counter=1

while ($counter <= some maximum number){

$arrayvalue="var".$counter

write $arrayname[$arrayvalue] to database

$counter++;
}

That should get the job done.

One other idea (depending on if you are just storing data or if you need to
manipulate it) is to serialize or implode the array and store the result of
the serialize/implode operation in the database.

John Guynn

This email brought to you by RFCs 821 and 1225.


-----Original Message-----
From: RealGM [mailto:[EMAIL PROTECTED]]
Hi,

I have a bit of a dilemma.

I have a number of array attributes, eg. $arrayname["var1"],
$arrayname["var2"], $arrayname["var2"], etc. up to 58, and I want to write
these into the database.

What I am hoping to do is create a counter that goes through the insert
routine, updating the numerical value of "var".  The problem is.. everything
I have tried hasn't worked.

I have tried things like...

$counter=1;

$arrayname[["var".$counter1]];
$arrayname["var$counter1"];
 
...and variations thereof.  Everything I have tried has failed.

PLEASE can someone help??



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to