title: Undefined error in accessing results from url
body: <p>I'm making ajax call to search movies using the imdb api and I noticed for queries with spaces I get error; <code>Undefined variable: id in C:\wamp\www\..</code> for some of the results. How can I fix this?</p>
  
  <pre><code>($row = mysql_fetch_assoc($sql));
   $id = $row['imdb_id'];
  
   $test = "http://imdbapi.org/?id=tt00".$id."&amp;type=json&amp;plot=simple&amp;episode=1&amp;lang=en-US&amp;aka=simple&amp;release=simple&amp;business=0&amp;tech=0";   
   $cont = file_get_contents ($test);
   $data = json_decode($cont, true);   
   $title = $data['title'];    
   echo "$title"; 
  </code></pre>