SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: copy a query

  1. #1
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,658
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    copy a query

    On my site I have 2 combo boxes (1 to select a member to delete and another to select a member to edit). The Delete one uses a mysql culomn to populate it,\
    HTML Code:
    <select name="id" id="name">
    )<option value="0" selected>(please select:)</option>
    <?php   while($row = mysql_fetch_assoc($result))
    {
        echo "<option value=".$row['id'].">".$row['Last_Name'].", ".$row['First_Name']."</option>";
    } 
    ?>
    </select>                                                     
    How do /I copy it so that the Edit one is populated like that one?
    http://mvsr.org/secure/members.php

    Do I have to query the database again or is there a better way"?
    Thanks...
    "Oh, and Jenkins--apparently your mother died this morning."

  2. #2
    Non-Member
    Join Date
    Dec 2010
    Location
    /home/pc
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you want to use the same query result set for both combo boxes, you can use mysql_data_seek before creating the second combo box.

  3. #3
    SitePoint Wizard donboe's Avatar
    Join Date
    Jun 2010
    Location
    Netherlands
    Posts
    2,147
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why not make just 1 select/combo box with member names and two radio buttons(1 for edit and 1 for delete), and depending which radio button chosen take the appropriate action!

  4. #4
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,658
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    thanksss
    "Oh, and Jenkins--apparently your mother died this morning."


Bookmarks

Posting Permissions

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