title: How to update MySQL Rows using PHP PDO Prepared Statements
body: <p>This is how I am receving data from a page: </p>
  
  <pre><code> $response = file_get_contents("https://api.themoviedb.org/3/movie/550?api_key=xxxxxx");
      if ($response != FALSE) {
          $response = json_decode($response, true);
      }
  </code></pre>
  
  <p>And here is an example of what is inside the page: </p>
  
  <pre><code>{
  
    "genres": [
      {
  
        "name": "Action"
      },
      {
  
        "name": "Adventure"
      },
      {
  
        "name": "Science Fiction"
      }
    ]
  
  }
  </code></pre>
  
  <p>Here is how, I Insert the data</p>
  
  <pre><code>$stmt = $conn-&gt;prepare("UPDATE genres SET genres_name = :genres_name WHERE tmdb_id = :tmdb_id");
  
      $stmt-&gt;bindParam(':tmdb_id', $tmdb_id,PDO::PARAM_INT);
      $stmt-&gt;bindParam(':genres_name', $genres_name,PDO::PARAM_INT);
  
  if (isset($response["genres"]) &amp;&amp; is_array($response["genres"])) 
  {
      foreach ($response["genres"] as $genreObject) 
      {
          $genres_name = $genreObject["name"];
          $stmt-&gt;execute();
      } 
  }
  </code></pre>
  
  <p><strong>Original Result:</strong></p>
  
  <p>This is the data it update inside <code>Genres</code> table</p>
  
  <pre><code>tmdb_id         genres_name
  5                Action
  5                Action
  5                Action
  </code></pre>
  
  <p>Expected Result:</p>
  
  <pre><code>tmdb_id         genres_name
  5                Action
  5                Adventure
  5                Science Fiction
  </code></pre>