11-23-2017, 01:33 PM
It absolutely makes sense. That's the big benefit of first.
You basically have three different ways to do what you're talking about.
The first is to use the OCE (one click edit feature). You can see it in action in the "IOT and MQTT" button on your dashboard. If you edit that MQTT server on the right, you get an idea for the look and feel. Basically click on a box lets you edit it and clicking off the box changes it in the database without reloading the page. The users/mqtt_settings.php file is fully commented to show you how to implement this.
The second is to use a foreach loop. I decided to write you a code snippet that you can paste right in the body of your index.php file to test how this works. Essentially you need your name attribute on the form to also have the id of the row you want to update in it. And instead of name just being a name, you need it to be an array. It's kind of hard to explain so I just wrote one that will let you edit the first name of every user in your database. Note that you may want to add some more checks before you allow it to update the database, but this is more of an example of how it works.
https://pastebin.com/Tn5PwdZA
I hope that helps. It's a weird concept, but I think this example is straightforward enough to help.
You basically have three different ways to do what you're talking about.
The first is to use the OCE (one click edit feature). You can see it in action in the "IOT and MQTT" button on your dashboard. If you edit that MQTT server on the right, you get an idea for the look and feel. Basically click on a box lets you edit it and clicking off the box changes it in the database without reloading the page. The users/mqtt_settings.php file is fully commented to show you how to implement this.
The second is to use a foreach loop. I decided to write you a code snippet that you can paste right in the body of your index.php file to test how this works. Essentially you need your name attribute on the form to also have the id of the row you want to update in it. And instead of name just being a name, you need it to be an array. It's kind of hard to explain so I just wrote one that will let you edit the first name of every user in your database. Note that you may want to add some more checks before you allow it to update the database, but this is more of an example of how it works.
https://pastebin.com/Tn5PwdZA
I hope that helps. It's a weird concept, but I think this example is straightforward enough to help.