So I'm trying to figure out a mysql statement that will get a complete gravity form entry, given the lead id, as an object. Can anyone help? The reason I want to pull directly from the gravity form database is that I want the administrator changes through the entries tabs to be reflected, instead of creating my own database table when forms are submitted. So far i've got-
SELECT wp_rg_lead_detail.value, wp_rg_lead_detail_long.value AS long_value
wp_rg_lead_detail_long ON id=lead_detail_id
WHERE lead_id=$id ORDER BY field_number;
This works okay, and gets the complete lead, with it's field number sorted. I guess I sort of answered my own question ^^. I can then get the field value by using an if statement, getting the detail value if the long value is empty (actually youd probably want to include the field_number in your sql statement as well)
Let me know if anyone has a better approach than this.