Forum Replies Created

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)