Jump to content

volunteer system, assigning volunteer with a venue


bradkenyon

Recommended Posts

I have a system that stores volunteers for a festival.

 

I am about to redesign it, to make it more efficient.

 

Currently I have it list their name, and I have an update/delete/view option next to it.

 

I envision adding another column to that volunteer listing, a drop down w/ all the different venues that this volunteer can be assigned to.

 

I want to know how you would be able to go down thru the list and select a venue for each volunteer in the list, then hit submit when I am done selecting each venue from each drop down list.

 

So when I hit submit, it will automatically assign/update every volunteer w/ the appropriate venue (based on which one you selected from that drop down list.

 

I'm not asking for the code, but asking for an explanation of how I would go about this, php and mysql wise.

 

Thank you very much.

Link to comment
Share on other sites

thank you

 

I know how to do that, but isn't it a little more elaborate when updating multiple records at the click of a button

 

Because you'll assign all the volunteers to a specific venue from a drop down list of possible choices, then it will go thru the list and plug the updates to each record

 

Maybe a while loop to go down the list and plug each one into the db table?

Link to comment
Share on other sites

Oh, okay.  That makes things much easier.  I assume that you have a venues table and a volunteers table?  And you link the volunteers table to the venues table through a pk/fk on the tables?  Or are you storing them as like, text in the volunteers column?  If you are, you'll want to do what I said at the beginning of the post.

Link to comment
Share on other sites

have the form like this:

<option name="venues_uid1"><option value="venue number">Venue Name</option> Etc. </option>

have the number as the user id of that user....

example:

for user 4, its like this:

<option name="venues_uid4"><option value="venue number">Venue Name</option> Etc. </option>

 

 

 

and the backends like this:

 

$users =mysql_query("SELECT * FROM user table")or die(mysql_error());

while($user = mysql_fetch_array($users)){

$id = $user['id']; //user id

 

$decide = 'venues_uid'.$id;

if(isset($_POST[$decide])){

update database;

}

 

}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.