06-20-2017, 11:55 AM
Sure. It would probably be hard to do with any of the existing userspice functions because it would require a lot of modification, but you can definitely do it for all your tables. It would actually be pretty easy. You can't do it technically do it "concurrently" but you can do it in 2 quick steps.
You would do make the last column in your table something like ai (for auto-increment). Let's just say the table is called "data".
So you would load the page normally with something like...
Then you do everything you're going to do.
Then let's say you're going back to update the table, you'll do another final check...
//something changed!
//nothing changed
This is for a 1 row database but you could just do this by row if you have many lines.
You would do make the last column in your table something like ai (for auto-increment). Let's just say the table is called "data".
So you would load the page normally with something like...
Code:
$dataQ = $db->query("SELECT * FROM data");
Code:
$data = $dataQ->results();
Then you do everything you're going to do.
Then let's say you're going back to update the table, you'll do another final check...
Code:
if(!empty($_POST)){
Code:
$checkQ = $db->query("SELECT * FROM data");
Code:
$check = $checkQ->results();
Code:
if($checkQ->ai != dataQ->ai){
Code:
}else{
Code:
$fields = array(
Code:
'mydata' => $mydata,
Code:
'ai' => $data->ai+1,
Code:
);
Code:
$db->update('data',1,$fields);
Code:
}