Jump to content

CRUD View - Update multiple records using drop down menu and check boxes


EarthDay

Recommended Posts

Hi there,

I was wondering if someone could point me in the right direction please?

I am trying to alter my CRUD view table by adding a check box to the row and using a drop down menu to update a field in the database for multiple records.

Say that a client has a status of referral and I want to change multiple clients to In Progress, I want to be able to select the clients and use the drop down menu to update the status.

Any help would greatly be appreciated.

Thanks, ED. 

Link to comment
Share on other sites

you would use an array name for the checkbox field, with the record id used for either the array index or the checkbox value. only checked checkboxes will be set in the submitted form data, so you can detect if any are set (the field name will be set), and get all the checked record ids. you would then use the submitted status value to update the records with those ids. you can use a single FIND_IN_SET() statement in the WHERE clause to do this using one single database query.

Link to comment
Share on other sites

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.