PHP - unexpected '}'

 
Vista:
sin imagen de perfil

unexpected '}'

Publicado por Erik (2 intervenciones) el 13/01/2018 16:46:25
Screenshot_2

No entiendo el error porque el "}" es del while

Les dejo el código

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html>
<head>
	<title>Paginacion</title>
</head>
<body>
 
<?php
 
try{
 
$base=new PDO("mysql:host=localhost; dbname=games", "root", "root");
 
$base->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
 
$base->exec("SET CHARACTER SET utf8");
 
$sql_total="SELECT ID, NOMBRE, COVER, SINOPSIS, ESTRELLAS, DESARROLLADOR FROM GAMES";
 
$resultado=$base->prepare($sql_total);
 
$resultado->execute(array());
 
while($registro=$resultado->fetch(PDO::FETCH_ASSOC)) {
 
echo "ID: " . $registro["ID"] . "NOMBRE" . $registro["NOMBRE"] . "COVER" . $registro["COVER"] . "SINOPSIS" . $registro["SINOPSIS"] . "ESTRELLAS" . $registro["ESTRELLAS"] . "DESARROLADOR" . $registro["DESARROLADOR"] . "<br>";
 
}
 
$resultado->closecursor
 
}catch(Exception $e){
 
  echo "error: " . $e->getLine();
 
}
 
?>
 
</body>
</html>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil
Val: 604
Bronce
Ha mantenido su posición en PHP (en relación al último mes)
Gráfica de PHP

unexpected '}'

Publicado por Miguel (218 intervenciones) el 13/01/2018 18:02:23
En la línea 30 te falta un punto y coma...
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
2
Comentar

unexpected '}'

Publicado por Erick (2 intervenciones) el 13/01/2018 18:07:14
Muchas gracias bro, se me había pasado
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar