File tree 2 files changed +25
-10
lines changed
2 files changed +25
-10
lines changed Original file line number Diff line number Diff line change @@ -58,11 +58,16 @@ class="btn btn-primary" id="btn_salvar">
58
58
59
59
$ sql = "select * from book; " ;
60
60
61
- if (Conexao::execWithReturn ($ sql )){
62
- print_r (Conexao::getData ());
63
- }else {
61
+ if (!Conexao::execWithReturn ($ sql )){
64
62
echo Conexao::getErro ();
63
+ exit (1 );
65
64
}
65
+ //print_r(Conexao::getData());
66
+ $ dados = Conexao::getData ();
67
+ //print_r($dados);
68
+ //foreach($dados as $livro){
69
+ foreach ($ dados as $ livro ):
70
+
66
71
?>
67
72
<section class="d-flex">
68
73
<div class="livro-imagem">
@@ -71,15 +76,21 @@ class="btn btn-primary" id="btn_salvar">
71
76
<div class="livro-contexto">
72
77
<p class="livro-dados">
73
78
Livro:
74
- <span id="livro-nome">Sonhos</span>
79
+ <span id="livro-nome">
80
+ <?= $ livro ["nome " ]; ?>
81
+ </span>
75
82
</p>
76
83
<p class="livro-dados">
77
84
Páginas:
78
- <span id="livro-paginas">168</span>
85
+ <span id="livro-paginas">
86
+ <?= $ livro ["paginas " ]; ?>
87
+ </span>
79
88
</p>
80
89
<p class="livro-dados">
81
90
Autor/a/as/es:
82
- <span id="livro-autores">Desconhecido</span>
91
+ <span id="livro-autores">
92
+ <?= $ livro ["autor " ]; ?>
93
+ </span>
83
94
</p>
84
95
</div>
85
96
<div class="livro-marcos">
@@ -101,6 +112,10 @@ class="btn btn-primary" id="btn_salvar">
101
112
</div>
102
113
</div>
103
114
</section>
115
+ <?php
116
+ //}//foreach
117
+ endforeach ;
118
+ ?>
104
119
</div>
105
120
</main>
106
121
</body>
Original file line number Diff line number Diff line change 2
2
3
3
class Conexao {
4
4
5
- private static $ servername = "ec2-52-200-215-149 .compute-1.amazonaws.com " ;
6
- private static $ username = "wsulibenxqrgjy " ;
7
- private static $ password = "7f21cafb2f054ebb40a34115d32ffb46996fc77468d29d78e3e689d50b053bce " ;
8
- private static $ dbname = "d3d56eb5id3f9e " ;
5
+ private static $ servername = "ec2-50-19-255-190 .compute-1.amazonaws.com " ;
6
+ private static $ username = "xagzsolvoukveu " ;
7
+ private static $ password = "736d2a3dc079f8d2dcbdb209a85a057ef9a04ac088b749cf1557a099e64584d4 " ;
8
+ private static $ dbname = "d5m9r6efhkkk9g " ;
9
9
private static $ erro = "" ;
10
10
private static $ data = null ;
11
11
private static $ conn = null ;
You can’t perform that action at this time.
0 commit comments