Edit Records - lokothodida/DM_Matrix GitHub Wiki

Editing records is very similar to adding them, only (obviously) the record must exist first in the table.

Using The Matrix's interface

From the main tab, click the table's name. You will be directed to the 'View' page.

foo-view2

The rightmost column, 'Options', should have a hash '#' for your desired record. Click it, and it will pull up a form just like the one used to create the record, but with the values already filled in using the existing record's details.

foo-edit-record

Submit the changes at the bottom for the record to be edited.

foo-edit-record-success

Advanced

Again, like creating records, updating records from outside The Matrix is relatively easy to do.

Example form (we are editing record 0)

<form method="post">
  <?php $var->displayForm('foo', 0); ?>
  <button>Submit</button>
</form>

Example POST query

if ($_SERVER['REQUEST_METHOD']=='POST') {
  $var->updateRecord('foo', 0, $_POST);
}

For further documentation on the use of the updateRecord method, please consult the Public Functions & Methods page.

⚠️ **GitHub.com Fallback** ⚠️