In questo file php c'è un errore di sintassi alla riga 51, l'ultima. L'errore è
Parse error: syntax error, unexpected $end in table2.php on line 51
e il file table2.php è questo
codice:
<?php
// Collegamento a MySQL
$db = mysql_connect('localhost', 'bp6am', 'bp6ampass') or die('Unable to connect. Check your connection parameters.');
// Ci si assicura di usare il database corretto
mysql_select_db('moviesite', $db) or die(mysql_error($db));
// Recupera le informazioni
$query = 'SELECT movie_name, movie_year, movie_director, movie_leadactor, movie_type
FROM movie
ORDER BY movie_name ASC, movie_year DESC';
$result = mysql_query($query, $db) or die(mysql_error($db));
// Determina il numero di righe nel risultato restituito
$num_movies = mysql_num_rows($result);
$table = <<<ENDHTML
<div style="text-align: center;">
<h2>Movie Review Database</h2>
<table border="1" cellpadding="2" cellspacing="2" style="width: 70%; margin-left: auto; margin-right: auto;">
<tr>
<th>Movie Title</th>
<th>Year of Release</th>
<th>Movie Director</th>
<th>Movie Lead Actor</th>
<th>Movie Type</th>
</tr>
ENDHTML;
// Scorrere i risultati
while ($row = mysql_fetch_assoc($result))
{
extract($row);
$table .= <<<ENDHTML
<tr>
<td>$movie_name</td>
<td>$movie_year</td>
<td>$movie_director</td>
<td>$movie_leadactor</td>
<td>$movie_type</td>
</tr>
ENDHTML;
}
$table .= <<<ENDHTML
</table>
$num_movie Movies</p>
</div>
ENDHTML;
echo $table;
?>
Non riesco a capire dove manca la parentesi.