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

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


0