Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Selection then insertion

Status
Not open for further replies.

Nematoth

Programmer
Mar 29, 2002
48
MY
Hi,

I have a dynamically generated page which list all users on a system. Next to each user is a checkbox. I want to be able to select multiple users (by checking the checkboxes)and then update another table in the database with the username associated with that checkbox.

The idea is that the user selects users to work on a project from the whole list of users. This would then update the table that relates projects to users by inserting a unique value, their username, and the project number.

I cannot seem to associate the checkboxes with the relevant username....

Does anyone have any ideas on how I can do this?

Thomas Shearer
Multimedia Developer
 
What language are you using for the application? PHP, Perl or ASP or ... ? I think you are better off putting the question in a forum concerned with the specific langauge as this does not have that much to do with Mysql.
 
What about

1. Set up a multiple list box <select name=checkusers[] multiple> etc.. in HTML

2. Use PHP implode function
$userlist=implode(&quot;','&quot;,$checkusers);
$userlist=&quot;where user in ('&quot;.$userlist.&quot;')&quot;;

this will give you a nice list like this to use in a query

where user in ('bob','dan','frank','zappa','lives')
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top