We are creating a form where a student submits work - data is inserted into the database. When they resubmit their work, the data is updated. We want to show how many resubmissions they have done (ie, how many times the data row, has been updated) without having to create a new row of data each time they resubmit.
In a PHP block within the "record found":
return $this->get("read_data#.model.field") + 1;Then in your save data action, for the incrementing field, in the "override on update" bit,field:{var:php_block_name}
field:{var:php_block_name/1}Also: editing the previous post.
On a similar note, how can we get the "first matching record" to select the newest row? It seems to be selecting the first row it finds (ie smallest aid in the table) which happens to be the oldest.
Edit: It's okay, solved that. We just have to put the relevant field under 'Order fields' in the read_data function.
