Problema MYSQL
¿Me podrías chequear este código?
Me da el siguiente error:
Parse error: syntax error, unexpected T_ECHO, expecting ',' or ';' in C:\wamp\www\Web\plantilla.php on line 65
Código:
<?php
$conn = mysql_connect("localhost", "root", "") or die ('Error connecting to mysql');
mysql_select_db("jugadores") or die(mysql_error());
$query = "SELECT Jugador, Posicion, Cualidades FROM datos";
$result = mysql_query($query);
echo "
<table border='1'>
";
echo "
<tr>
<th>Name</th> <th>Age</th>
</tr>
";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
echo "
<tr>
<td>";
echo $row['Jugador'];
echo "</td>
<td>";
echo $row['Cualidades'];
echo "</td>
</tr>
";
}
echo "
</table>
";
?>
Me da el siguiente error:
Parse error: syntax error, unexpected T_ECHO, expecting ',' or ';' in C:\wamp\www\Web\plantilla.php on line 65
Código:
<?php
$conn = mysql_connect("localhost", "root", "") or die ('Error connecting to mysql');
mysql_select_db("jugadores") or die(mysql_error());
$query = "SELECT Jugador, Posicion, Cualidades FROM datos";
$result = mysql_query($query);
echo "
<table border='1'>
";
echo "
<tr>
<th>Name</th> <th>Age</th>
</tr>
";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
echo "
<tr>
<td>";
echo $row['Jugador'];
echo "</td>
<td>";
echo $row['Cualidades'];
echo "</td>
</tr>
";
}
echo "
</table>
";
?>
Respuesta de zagalet
1