• I have used CF-repeater and its add new filed named as
    username__1
    username__2
    username__3
    email__1
    email__2
    email__3
    etc …

    when exporting about 150 forms to csv, many time didn’t get the repeater data, and its only add the first data (username__1) only

    some user fill the form and they has 1 username, and other have 4 username

Viewing 1 replies (of 1 total)
  • Thread Starter ezako

    (@ezako)

    I found the problem that he gets heading_row from last new form added
    and if the last form has 2 username, so the csv will have heading for 2 username username__1, username__2

    also if latest form added had 1 username (username__1), so heading_row will have only 1 username (username__1) as in the same time there is another rows has more that 1 username

    I fixed this by sorting the heading_row by the length of value to get the highest row to have the most length in form_value

    line 81,82

    instead of

     $heading_row = $cfdb->get_results("SELECT form_id, form_value, form_date FROM $table_name
    WHERE form_post_id = '$fid' ORDER BY form_id DESC LIMIT 1",OBJECT);

    to be

     $heading_row = $cfdb->get_results("SELECT form_id, form_value, form_date FROM $table_name
    WHERE form_post_id = '$fid' ORDER BY CHAR_LENGTH(form_value) DESC LIMIT 1",OBJECT);

    I hope if you have a better solution
    thanks for your great plugin

    • This reply was modified 4 years, 8 months ago by ezako.
Viewing 1 replies (of 1 total)
  • The topic ‘export csv , not export all data’ is closed to new replies.