• File: admin.php
    Row: 1194

    Problem: importing matches from CSV doesn’t set the correct date (“N/A” imported)

    Reason: the “date” field in query is not surrounded by quotes, so MySQL could misunderstand it

    $sql = “INSERT INTO {$wpdb->leaguemanager_matches} (date, home_team, away_team, match_day, location, league_id, season, final, custom,group) VALUES (‘%s’, ‘%s’, ‘%s’, ‘%d’, ‘%s’, ‘%d’, ‘%s’, ‘%s’, ‘%s’, ‘%s’)”;

    Fix: just surround date with quotes

    $sql = “INSERT INTO {$wpdb->leaguemanager_matches} (date, home_team, away_team, match_day, location, league_id, season, final, custom,group) VALUES (‘%s’, ‘%s’, ‘%s’, ‘%d’, ‘%s’, ‘%d’, ‘%s’, ‘%s’, ‘%s’, ‘%s’)”;

    • This topic was modified 8 years, 6 months ago by Defkon1.
  • The topic ‘[FIX] Missing quotes in matches import’ is closed to new replies.