title: Update table list in wordpress plugin admin
body: <p>I have this script that should update the data when I change its value. But this code is not working. I dont know whats the problem with it.</p>
  
  <pre><code>function update_data(){
  global $wpdb;
      if(isset($_POST['update'])) 
                  {
                          $won = $_POST['won'];
                          $lost = $_POST['lost'];
                          $pct = $_POST['pct'];
                          $streak = $_POST['streak'];
  
                      $id = $wpdb-&gt;get_results("SELECT a.team_id, a.team_name, a.program_id ,b.games_won, b.games_lost, b.game_pct, b.winning_streak
                                  FROM  program_teams as a
                                  INNER JOIN program_team_standings as b
                                  ON a.team_id=b.team_id");    
                      foreach ($id as $row) {
                           $id = $row-&gt;team_id;
                  }
                  $we = $wpdb-&gt;query("UPDATE program_team_standings
                              SET games_won = '$won',
                                  games_lost ='$lost',
                                  game_pct = '$pct',
                                  winning_streak =&gt; '$streak'
                              WHERE team_id =&gt; '$id' ");                           
          echo "&lt;script&gt;alert('Team is now updated'); &lt;/script&gt;";
  }
  </code></pre>
  
  <p>I hope someone can help me.thank you!</p>