Reputation: 19
I am new to wordpress gravity forms and kit. I am able to save a form data into the database. I am able to resubmit the same form any number of times which adds to multiple entries for it in the database. I have a view form (gravity view) in the front end website to show the saved data from the database. As multiple entries for the same form gets created every time i save the form, I want to fetch the latest entry to display in the front end website. Please explain how to achieve this.
Upvotes: 1
Views: 850
Reputation: 46
You could do it with a simple MySQL query:
global $wpdb;
$table = $wpdb->prefix . 'gf_entry_meta';
$sql = "SELECT * FROM $table ORDER BY `date_created` DESC LIMIT 1";
$result = $wpdb->query($sql);
More on the Gravity Forms database structure here.
Upvotes: 1