I am using gravity to collect form and using PHP to echo It, is’t showing error if a field is empty instead of leaving it blank, can anyone please help?
here is the error:
Warning: Undefined variable $value in /home/……functions.php on line 169
My code is //get gravity forms fields by form field id function get_gf_form_fields_value_by_id($entry_id,$field_id){ global $wpdb; $results = $wpdb->get_results( "SELECT meta_value FROM {$wpdb->prefix}gf_entry_meta WHERE meta_key = $field_id AND entry_id = $entry_id LIMIT 1 ", OBJECT ); foreach($results as $result){ $value = $result->meta_value; } return $value; }