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<count($cast['id']);$i++) //LINE 31
{
$output .= "<tr>";
$mname = getMovieNameById($m_id);
$output .= "<td><a href='single.php?id=$m_id'>$mname</a></td>";
$aname = getArtistNameById($cast['id'][$i]);
$output .= "<td><a href=project.php?id={$cast['id'][$i]}>$aname</a></td>";
}
This code works fine in the web server but throws errors(notice) when executed on localhost
Notice: Undefined index: id in C:\wamp\www\Tinyflick\managemovie.php on line 31
What can be the problem? The rest of the code seems to work just fine