Support » Plugin: Football Pool » Export user pool data

  • Hello,
    What do you recommend to export user input data (scores and questions)? I am looking a way to email the data entered to each participant.

    Regards,
    Marcelo

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author AntoineH

    (@antoineh)

    I can’t recommend anything from personal experience. But I would look first for database plugins or maybe create a view in phpMyAdmin from an SQL query and use the output of the view to export to csv.

    Here’s some SQL queries to get you started:

    —- Aggregated Report —-

    SELECT
    u.ID AS User_ID,
    u.display_name AS User_Name,
    l.name AS League,
    u.user_email AS User_Email,
    IFNULL(COUNT(p.user_id), 0) AS Nr_of_predictions,
    SUM(p.has_joker) AS JOKER_VALUE
    FROM wp_users u
    LEFT OUTER JOIN pool_wp_predictions p ON ( u.ID = p.user_id )
    JOIN pool_wp_league_users lu ON ( lu.user_id = u.id )
    JOIN pool_wp_leagues l ON ( l.id = lu.league_id )
    GROUP BY u.id
    ORDER BY u.id
    ;

    —- Detailed report —-

    SELECT
    p.user_id AS User_ID,
    u.display_name AS User_Name,
    l.name AS League,
    u.user_email AS User_Email,
    p.match_id AS Match_ID,
    t.name AS Home_Team,
    p.home_score AS Home_Team_Score_Prediction,
    t1.name AS Away_Team,
    p.away_score AS Away_Team_Score_Prediction,
    p.has_joker AS Joker_Match
    FROM pool_wp_predictions p
    JOIN wp_users u ON ( u.ID = p.user_id )
    JOIN pool_wp_matches m ON ( m.id = p.match_id )
    JOIN pool_wp_teams t ON ( t.id = m.home_team_id )
    JOIN pool_wp_teams t1 ON ( t1.id = m.away_team_id )
    JOIN pool_wp_league_users lu ON ( lu.user_id = u.id )
    JOIN pool_wp_leagues l ON ( l.id = lu.league_id )
    Order by p.match_id
    ;

    Thread Starter mvergaraochoa

    (@mvergaraochoa)

    Thank you very much!!
    Regards,
    Marcelo

    Thread Starter mvergaraochoa

    (@mvergaraochoa)

    Hello @sukritd, thank you for the SQL, it works!!! please can you send me the sql to get data about the questions?

    Regards,
    Marcelo

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Export user pool data’ is closed to new replies.