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 2 of 2

Thread: Copy Array

  1. #1
    New Coder
    Join Date
    Jun 2007
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Copy Array

    Howdy,

    I currently have a table that contains the following fields:

    • Name
    • Species
    • Sex


    How do I copy all information stored in the table into an array, then display each record on the page along with a check box?

    Upon a record being checked, and a submit button being clicked, how do I copy all but the selected records into a second array?

    Many Thanks,

  • #2
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    $sql = "SELECT * FROM table";
    $result = mysql_query($sql);
    while ($row = mysql_fetch_array($result)) {

    echo "$row['name']";
    echo $row['species'];
    echo $row['sex'];


  •  

    Posting Permissions

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