I don’t understand the question, I’m sorry. Take a look at the Participants Database API, you may find what you are looking for there.
I have a table which has 5 different entries from different users, for example, the fifth user whose entry is in fifth place wants to raise it to the first position. For this we need to overwrite (recreate) record, want to do it all in one code(function/class), but don’t know how to create a new record with the current data where knlan this record and deletes the old. You have to hook API see “pdb-after_submit_update” as it is correct to shove?
There is a function that filters
$current_user = wp_get_current_user();
global $wpdb;
$wpdb->update( 'wp_participants_database',
array( 'none' => "123"),
array( 'enterprise' =>$current_user->display_name)
`
here we see what record made update where display_name=$current_user = wp_get_current_user(). With the same filter should be a hook, as it can be used correctly, can you tell?
I’m sorry, I just don’t understand exactly what you are trying to do. Possibly this can all be done with a MySQL query that gets the data from one record and puts it into a new one. But I don’t understand why you need to do it this way, it sounds like all you really need to do is order the records by a different column, not the ID column. You can then re-order the records by changing the values in that column.
Excuse me, but how to sort? ORDER BY does not change the position of the record in the table
The plugin has settings for ordering the records in the table. Take a look at the plugin documentation where is explains how to set the order of the list in the list shortcode. There is also a global list order setting in the plugin settings under the list display tab.
You don’t understand. I want the BUTTON when clicked all the records the user has updated and took the top position
If you want the recently updated record to go to the top, you need to sort by the timestamp for when the record was updated. Your code does not update the ‘date_updated’ field, so you will need to add that…or you can use the Participants_Db::write_participant( $data, $id ) method to update the record, and the date_update field will be updated when that happens. Then, when the list is re-displayed, the newly updated record can be at the top of the list.
There are other ways to do this, but that is probably the simplest.