Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: Help with Array

  1. #1
    New Coder
    Join Date
    Jul 2007
    Posts
    62
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Help with Array

    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.

    PHP Code:
    $amount=array();
    for 
    every db record{

    //what can go here ? ...

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



  • #2
    Regular Coder
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    159
    Thanks
    2
    Thanked 15 Times in 15 Posts
    That kinda depends on what you want to achieve. You put anything you want to do with "every db record" in there.


    ~Jordan
    Remember The Thank You Button Is Your Friend =]

    [ PHP / Javascript / VisualBasic / HTML / DHTML / CSS / .NET / MySQL ]

  • #3
    New Coder
    Join Date
    Jul 2007
    Posts
    62
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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

  • #4
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,638
    Thanks
    2
    Thanked 404 Times in 396 Posts
    Pretty much anything can go there.

  • #5
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    This code can go there.

    PHP Code:
    for ($i 1$i 0$i++) {
        echo 
    'This code is useful';



  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •