Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2006

    Unanswered: Working with two menu

    I use mySQL 4.1
    I have a PHP script that show two select menu.

    First Menu               Second Menu
    ========                 ===========
    The first menu show all users from mySQL table register
    I press a button to put two users to Second Menu. I have a picture here.

    Now when I press on submit, my PHP script add all users from "Second Menu" (yo2lux, zoli) to group 2.

    This is my table user2groups

    uid         gid
    ===       ===
    1            2
    3            2
    This mean:

    user with id 1 (yo2lux) is added to group 2
    user with id 3 (zoli) is added to group 2

    Now I run again my PHP script. I see the two menu.
    In first menu I want to see all users from table register without : yo2lux and zoli because this users already added to user2groups table.

    Exist a solution to solve this problem ?
    I appreciate any answer, and thank you very much !

  2. #2
    Join Date
    Jan 2005

    an idea

    there are two solutions I can think of. One is use javascript. I am not the one to ask how, but this is what js is all about.

    the other solution would be to use two session variables.

    if the menu1 session is not set then get the data from the database

    process form

    if the add item button is set remove the item from $_SESSION['menu1'] array and add it to $_SESSION['menu2'] array. then vice versa.

Posting Permissions

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