PHP code woks on server but throws errors in localhost
<pre><code>for($i=0;$cast_row = mysql_fetch_array($res);$i++)
{
    $cast['id'][] = $cast_row['user_id'];
    $cast['role'][] = $cast_row['role'];
    $cast['role_name'][] = $cast_row['role_name'];
    $cast['is_approved'][] = $cast_row['is_approved'];
    $cast['movie_id'][] = $cast_row['movie_id'];
}
for($i=0;$i&lt;count($cast['id']);$i++) //LINE 31
{
    $output .= "&lt;tr&gt;";
    $mname = getMovieNameById($m_id);
    $output .= "&lt;td&gt;&lt;a href='single.php?id=$m_id'&gt;$mname&lt;/a&gt;&lt;/td&gt;";

    $aname = getArtistNameById($cast['id'][$i]);
    $output .= "&lt;td&gt;&lt;a href=project.php?id={$cast['id'][$i]}&gt;$aname&lt;/a&gt;&lt;/td&gt;";
}
</code></pre>

<p>This code works fine in the web server but throws errors(notice) when executed on localhost</p>

<blockquote>
  <p>Notice: Undefined index: id in C:\wamp\www\Tinyflick\managemovie.php on line 31</p>
</blockquote>

<p>What can be the problem? The rest of the code seems to work just fine</p>
