Topic: datatable editor - save changes in sql database
DanielKYantis priority asked 2 years ago
How do I save this to my sql database once it is edited?It lets me edit but then what?I am obviously new to this. Thank you for your help.
`<div class="table-editor" id="table_1" data-mdb-entries="5" data-mdb-entries-options="[5, 10, 15]"
> <table class="table">
<thead>
<tr>
<th class="th-sm">username</th>
<th class="th-sm">fname</th>
<th class="th-sm">lname</th>
<th class="th-sm">email</th>
<th class="th-sm">cellPhone</th>
</tr>
</thead>
<tbody>
<?php> $db->query("SELECT * FROM users"); foreach ($db->results() as $record) {
echo
"<tr>
<td>" . $record->username . "</td>
<td>" . $record->fname . "</td>
<td>" . $record->lname . "</td>
<td>" . $record->email . "</td>
<td>" . $record->cellPhone . "</td>
</tr>"
; }; ?>
</tbody> </table> </div>`
Grzegorz Bujański staff answered 2 years ago
You can catch update.mdb.tableEditor
event. This event returns updated data. You can find more about events here https://mdbootstrap.com/docs/standard/plugins/table-editor/#docsTabsAPI
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Priority
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 3.11.0
- Device: any
- Browser: chrome
- OS: any
- Provided sample code: No
- Provided link: No