View Full Version : Help with Array

11-20-2007, 09: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.

for every db record{

//what can go here ? ...

$_SESSION["sum1"] = array( strval("id" . $result["id"]) => $sum1);


11-20-2007, 09:27 PM
That kinda depends on what you want to achieve. You put anything you want to do with "every db record" in there.


11-20-2007, 09: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

11-20-2007, 11:14 PM
Pretty much anything can go there.

11-20-2007, 11:21 PM
This code can go there.

for ($i = 1; $i > 0; $i++) {
echo 'This code is useful';