eduehi 0 Denunciar post Postado Dezembro 3, 2015 Boa tarde Pessoal, sou novo no fórum e iniciante em PHP, e preciso criar uma paginação de conteúdo, gostaria de exibir 3 resultados na página, e demais paginados. Segue me código: <?php class Home { public function run() { $html_home = new Html(); $html = $html_home->load('view/home.html'); $tcomunicados = ''; $taniver = ''; $tdados = Connection::select("select * from comunicados limit 3"); foreach ($tdados as $reg) { $tcomunicados .= '<TR> <TD ROWSPAN=9 HEIGHT="auto" STYLE="border-top: 1px solid #f1f1f1;" class="text-center"><img src="' . $reg['imagem'] . '" width="150"></img></TD> <TD COLSPAN=5 VALIGN=MIDDLE STYLE="border-top: 1px solid #f1f1f1; border-bottom: 1px solid #f1f1f1;">' . $reg['titulo'] . '</TD> </TR> <TR> <TD COLSPAN=2><small><cite>' . $reg['por'] . '</cite></small></TD> <TD><BR></TD> <TD COLSPAN=2><em><small class="subheader">' . $reg['data'] . '</small></em></TD> </TR> <TR> <TD COLSPAN=5 ROWSPAN=6>' . $reg['comunicado'] . '</TD> </TR><TR></TR><TR></TR><TR></TR><TR></TR><TR></TR><TR> <TD></TD> <TD></TD><TD><br></TD> <TD></TD> <TD></TD> </TR>'; } $tdados2 = Connection::select("SELECT * FROM aniversarios"); foreach ($tdados2 as $reg) { $taniver .= '<TR> <td BGCOLOR="#FFD700" STYLE="border-bottom: 1px solid #f1f1f1" HEIGHT="15" ALIGN="LEFT"><span><font size=2 color="#006400" ><b>' . $reg['data'] . '</span> - <span><font size=2 color="#006400">' . $reg['nome'] . '</span>, <span><font size=2 color="#006400">' . $reg['funcao'] . '</span> - <span><font size=2 color="#006400">' . $reg['filial'] . '</span></td> </TR><TR> </TR>'; } $html = str_replace('#TCOMUNICADOS#', $tcomunicados, $html); $html = str_replace('#TANIVER#', $taniver, $html); return $html; } } Eu to criando um portal de noticias, onde vou fazer o upload por um formulário, e o mesmo tem que jogar a imagem pra uma pasta, e salvar o caminho no banco de dados. Se alguém puder me ajudar agradeço. Compartilhar este post Link para o post Compartilhar em outros sites