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.

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?

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.

now how would i go about updating multiple records by clicking submit.

 

because i'll go thru and assign each volunteer to a venue by selecting one from a drop down list of venues, which will appear next to each volunteer's name.

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;

}

 

}

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.