undefined variable
Hi! I have been trying to learn this and have run into a wall. I typed the code exactly as in the book (pg 114-115) and I kept getting this error "unexpected .<<. I searched the web and found the source code. It looked the same so I just copied and pasted....just to see if it would work. It did, but now I get the error, "Undefined variable: movie_details. Below is the code I have, the var $movie_details is used twice and only the second one gives the error. If someone would assist me I would REALLY appreciate it!
while($row = mysql_fetch_array($result))
{
$movie_name = $row['movie_name'];
$movie_director = $row['movie_director'];
$movie_leadactor = $row['movie_leadactor'];
$movie_details .=<<<EOD
<tr>
<td>$movie_name</td>
<td>$movie_director</td>
<td>$movie_leadactor</td>
</tr>
EOD;
}
$movie_details .=<<<EOD
<tr>
<td> </td>
</tr>
<tr>
<td>Total :$num_movies Movies</td>
</tr>
EOD;
|