• Hi there,

    Just testing your competition plugin, but finding a problem when I use the CSV export.

    The order of the columns mixes up – it’s as if it reads the first entry, sets the headers from that, then reads out the further entries in different orders (and it seems fairly random), making the download pretty useless for a large competition – too much manual work to re-align.

    Dummy test with just 3 entries below, as you can see the postcode never appears in the right column, phone numbers move etc

    entry_id,comp,entry_date,your-address,your-email,your-name,accept_tac,contact_me_by,which_mag,your_phone,your-postcode
    4,nintendo-comp,"2016-06-20 09:28:46",3333338978,"PE1 1TN","Midgate House, Floor 2 Midgate",[email protected],"Kristian Brown",1,"SMS, Phone, E-mail, Mail","Horrible Histories"
    5,nintendo-comp,"2016-06-20 09:30:49","pe4 3rf",3333333978,"Horrible Histories",Mail,1,"gsafdsafdsafsdfs afdsafdssa",[email protected],"ANother person"
    6,nintendo-comp,"2016-06-20 09:37:32","Phone, Mail",1,"Person 3",[email protected],"fgsfsdafdsa fdsaf sdf fsadf dsfa fdsafsdf sdafs dafsdfdsafsdfsd","pe1 3dd",3333333978,"Horrible Histories"

    https://www.ads-software.com/plugins/competition-form/

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

    (@krispy_b)

    until fixed, i’ve written the following SQL which gives me the data in a useable format;

    select ce.*, yn.meta_value as name,
        ya.meta_value as address, ypc.meta_value as postcode,
        ye.meta_value as email,
        ycmb.meta_value as contactby,
        ywm.meta_value as which_mag ,
        yp.meta_value as phone
    from
    (select id, entry_id,meta_value   from md_competition_entries_meta
    where meta_key = 'your-address' ) ya,
    (select id, entry_id, meta_value   from md_competition_entries_meta
    where meta_key = 'your-email' ) ye,
    (select id,entry_id, meta_value   from md_competition_entries_meta
    where meta_key = 'your-name' ) yn,
    (select id,entry_id, meta_value   from md_competition_entries_meta
    where meta_key = 'contact_me_by' ) ycmb,
    (select id,entry_id, meta_value   from md_competition_entries_meta
    where meta_key = 'which_mag' ) ywm,
    (select id,entry_id, meta_value   from md_competition_entries_meta
    where meta_key = 'your_phone' ) yp,
    (select id,entry_id, meta_value   from md_competition_entries_meta
    where meta_key = 'your-postcode' ) ypc, md_competition_entries ce
    where ce.id = ya.entry_id
    and ce.id = ye.entry_id
    and ce.id = yn.entry_id
    and ce.id = ycmb.entry_id
    and ce.id = ywm.entry_id
    and ce.id = yp.entry_id
    and ce.id = ypc.entry_id
Viewing 1 replies (of 1 total)
  • The topic ‘CSV export columns mix up’ is closed to new replies.