View Full Version : Help with Array
user55
11-20-2007, 08:25 PM
Can somebody provide an example of PHP code of //what can go here ? ... I just want to get an idea of what can or cannot go there.
$amount=array();
for every db record{
//what can go here ? ...
$_SESSION["sum1"] = array( strval("id" . $result["id"]) => $sum1);
}
JordanW
11-20-2007, 08:27 PM
That kinda depends on what you want to achieve. You put anything you want to do with "every db record" in there.
~Jordan
user55
11-20-2007, 08:31 PM
Hi, thanks for the reply.
What if I wanted to do this?
//compute the sum for the current record prior to this line
//store the computed value for the current record on an anonymous array and append to corresponding session
Inigoesdr
11-20-2007, 10:14 PM
Pretty much anything can go there.
aedrin
11-20-2007, 10:21 PM
This code can go there.
for ($i = 1; $i > 0; $i++) {
echo 'This code is useful';
}
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.