BJ-AMARAL 0 Denunciar post Postado Novembro 10, 2003 Eu to fazendo uma site de Fotos , e presciso na pagina principal ficar as fotos mais rescentes das saidas de noite, mais eu to fazendo aqui e ta ficando assim, vamos dizer que o jogo da velha e a foto,]#########mais eu tenho que fazer as fotos ficarem assim########mais eu não to conseguindo pq se eu colocar o while faz um embaixo do outro mais eu to prescisando uma do lado da outra,e tem que ser as colocadas mais rescentes, por favor se alguem poder posta ai um script pra mim ajudar ai eu agradeço de mais , isto não deve ser dificil fazer não, veja o script que eu fiz,<?phpinclude"abreconexao.inc";$sql = "select * FROM tb_galeria_foto_primaria ORDER BY cod LIMIT 0,8 ";$rs = mysql_query($sql, $conexao) or die ("Não foi possivel efetuar a consulta");while ($linha = mysql_fetch_array($rs)) {$cod = $linha['cod'];$foto_pri = $linha['foto_pri'];$foto_envento = $linha['foto_evento'];$descri = $linha['descri'];$data = $linha['data'];$dia_semana = $linha['dia_semana'];?><table width="100%" border="0" cellspacing="0" cellpadding="0" height="84%"> <tr> <td valign="top" height="8"> <div align="center"><img src="barra/ult_b.gif" width="526" height="25" align="middle"></div> </td> </tr> <tr> <td valign="top" height="602"><table width="604" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><img src="barra/b_d_e/spacer.gif" name="undefined_3" width="12" height="1" border="0"></td> <td><img src="barra/b_d_e/spacer.gif" name="undefined_3" width="128" height="1" border="0"></td> <td><img src="barra/b_d_e/spacer.gif" name="undefined_3" width="162" height="1" border="0"></td> <td><img src="barra/b_d_e/spacer.gif" name="undefined_3" width="1" height="1" border="0"></td> <td><img src="barra/b_d_e/spacer.gif" name="undefined_3" width="128" height="1" border="0"></td> <td><img src="barra/b_d_e/spacer.gif" name="undefined_3" width="163" height="1" border="0"></td> <td><img src="barra/b_d_e/spacer.gif" name="undefined_3" width="10" height="1" border="0"></td> <td><img src="barra/b_d_e/spacer.gif" name="undefined_3" width="1" height="1" border="0"></td> </tr> <tr> <td><img name="q_r1_c1" src="barra/b_d_e/q_r1_c1.gif" width="12" height="9" border="0"></td> <td colspan="5"><img name="q_r1_c2" src="barra/b_d_e/q_r1_c2.gif" width="582" height="9" border="0"></td> <td><img name="q_r1_c7" src="barra/b_d_e/q_r1_c7.gif" width="10" height="9" border="0"></td> <td><img src="barra/b_d_e/spacer.gif" name="undefined_3" width="1" height="9" border="0"></td> </tr> <tr> <td rowspan="3"><img name="q_r5_c1" src="barra/b_d_e/q_r5_c1.gif" width="12" height="137" border="0"></td> <td rowspan="2"> <div align="center"><a href="fotos.php?cod_fest=<? echo "$cod[0]" ?>"><IMG height=112 width=120 border=0 src="foto_principal/<? echo "$foto_pri[0]" ?>"></a></div> </td> <td rowspan="2"><table width="100%" height="101" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="55"><div align="center"><IMG height=43 src="foto_evento/<? echo "$foto_evento[0]"?>" width=100></div></td> </tr> <tr> <td height="23"> <div align="center"><FONT color=#004080 size="2" face=Verdana, Arial, Helvetica, sans-serif><STRONG><SMALL> <? echo "$descri[0]" ?> </SMALL></STRONG></FONT></div> </td> </tr> <tr> <td height="23"><div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><? echo "$data" ?></font> - <font size="2"><? echo "$dia_semana" ?></font></div></td> </tr> </table></td> <td><img name="q_r2_c4" src="barra/b_d_e/q_r2_c4.gif" width="1" height="134" border="0"></td> <td rowspan="2"> <div align="center"><a href="fotos.php?cod_fest=<? echo "$cod" ?>"><img height=112 width=120 border=0 src="foto_principal/<? echo "$foto_pri[1]" ?>"></a></div> </td> <td rowspan="2"> <table width="100%" height="101" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="55"> <div align="center"><img height=43 src="foto_evento/<? echo "$foto_evento[1]"?>" width=100></div> </td> </tr> <tr> <td height="23"> <div align="center"><font color=#004080 size="2" face=Verdana, Arial, Helvetica, sans-serif><strong><small> <? echo "$descri[0]" ?> </small></strong></font></div> </td> </tr> <tr> <td height="23"> <div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> <? echo "$data[1]" ?> </font> - <font size="2"> <? echo "$dia_semana[1]" ?> </font></div> </td> </tr> </table> </td> <td rowspan="3"><img name="q_r2_c7" src="barra/b_d_e/q_r2_c7.gif" width="10" height="137" border="0"></td> <td><img src="barra/b_d_e/spacer.gif" name="undefined_3" width="1" height="134" border="0"></td> </tr> <tr> <td><img name="q_r3_c4" src="barra/b_d_e/q_r3_c4.gif" width="1" height="1" border="0"></td> <td><img src="barra/b_d_e/spacer.gif" name="undefined_3" width="1" height="1" border="0"></td> </tr> <tr> <td height="2" colspan="5"><img name="q_r4_c2" src="barra/b_d_e/q_r4_c2.gif" width="582" height="1" border="0"></td> <td><img src="barra/b_d_e/spacer.gif" name="undefined_3" width="1" height="1" border="0"></td> </tr> <tr> <td rowspan="2"><img name="q_r5_c1" src="barra/b_d_e/q_r5_c1.gif" width="12" height="144" border="0"></td> <td> <div align="center"><a href="fotos.php?cod_fest=<? echo "$cod[2]" ?>"><img height=112 width=120 border=0 src="foto_principal/<? echo "$foto_pri[2]" ?>"></a></div> </td> <td> <table width="100%" height="101" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="55"> <div align="center"><img height=43 src="foto_evento/<? echo "$foto_evento[2]"?>" width=100></div> </td> </tr> <tr> <td height="23"> <div align="center"><font color=#004080 size="2" face=Verdana, Arial, Helvetica, sans-serif><strong><small> <? echo "$descri[2]" ?> </small></strong></font></div> </td> </tr> <tr> <td height="23"> <div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> <? echo "$data[2]" ?> </font> - <font size="2"> <? echo "$dia_semana[2]" ?> </font></div> </td> </tr> </table> </td> <td><img name="q_r5_c4" src="barra/b_d_e/q_r2_c4.gif" width="1" height="143" border="0"></td> <td> <div align="center"><a href="fotos.php?cod_fest=<? echo "$cod[3]" ?>"><img height=112 width=120 border=0 src="foto_principal/<? echo "$foto_pri[3]" ?>"></a></div> </td> <td> <table width="100%" height="101" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="55"> <div align="center"><img height=43 src="foto_evento/<? echo "$foto_evento[3]"?>" width=100></div> </td> </tr> <tr> <td height="23"> <div align="center"><font color=#004080 size="2" face=Verdana, Arial, Helvetica, sans-serif><strong><small> <? echo "$descri[3]" ?> </small></strong></font></div> </td> </tr> <tr> <td height="23"> <div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> <? echo "$data[3]" ?> </font> - <font size="2"> <? echo "$dia_semana[3]" ?> </font></div> </td> </tr> </table> </td> <td rowspan="2"><img name="q_r7_c7" src="barra/b_d_e/q_r2_c7.gif" width="10" height="144" border="0"></td> <td><img src="barra/b_d_e/spacer.gif" name="undefined_3" width="1" height="143" border="0"></td> </tr> <tr> <td colspan="5"><img name="q_r6_c2" src="barra/b_d_e/q_r4_c2.gif" width="582" height="1" border="0"></td> <td><img src="barra/b_d_e/spacer.gif" name="undefined_3" width="1" height="1" border="0"></td> </tr> <tr> <td rowspan="2"><img name="q_r7_c1" src="barra/b_d_e/q_r5_c1.gif" width="12" height="144" border="0"></td> <td> <div align="center"><a href="fotos.php?cod_fest=<? echo "$cod[4]" ?>"><img height=112 width=120 border=0 src="foto_principal/<? echo "$foto_pri[4]" ?>"></a></div> </td> <td> <table width="100%" height="101" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="55"> <div align="center"><img height=43 src="foto_evento/<? echo "$foto_evento[4]"?>" width=100></div> </td> </tr> <tr> <td height="23"> <div align="center"><font color=#004080 size="2" face=Verdana, Arial, Helvetica, sans-serif><strong><small> <? echo "$descri[4]" ?> </small></strong></font></div> </td> </tr> <tr> <td height="23"> <div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> <? echo "$data[4]" ?> </font> - <font size="2"> <? echo "$dia_semana[4]" ?> </font></div> </td> </tr> </table> </td> <td><img name="q_r7_c4" src="barra/b_d_e/q_r2_c4.gif" width="1" height="143" border="0"></td> <td> <div align="center"><a href="fotos.php?cod_fest=<? echo "$cod[5]" ?>"><img height=112 width=120 border=0 src="foto_principal/<? echo "$foto_pri[5]" ?>"></a></div> </td> <td> <table width="100%" height="101" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="55"> <div align="center"><img height=43 src="foto_evento/<? echo "$foto_evento[5]"?>" width=100></div> </td> </tr> <tr> <td height="23"> <div align="center"><font color=#004080 size="2" face=Verdana, Arial, Helvetica, sans-serif><strong><small> <? echo "$descri[5]" ?> </small></strong></font></div> </td> </tr> <tr> <td height="23"> <div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> <? echo "$data[5]" ?> </font> - <font size="2"> <? echo "$dia_semana[5]" ?> </font></div> </td> </tr> </table> </td> <td rowspan="2"><img name="q_r7_c7" src="barra/b_d_e/q_r2_c7.gif" width="10" height="144" border="0"></td> <td><img src="barra/b_d_e/spacer.gif" name="undefined_3" width="1" height="143" border="0"></td> </tr> <tr> <td colspan="5"><img name="q_r8_c2" src="barra/b_d_e/q_r4_c2.gif" width="582" height="1" border="0"></td> <td><img src="barra/b_d_e/spacer.gif" name="undefined_3" width="1" height="1" border="0"></td> </tr> <tr> <td><img name="q_r9_c1" src="barra/b_d_e/q_r5_c1.gif" width="12" height="140" border="0"></td> <td> <div align="center"><a href="fotos.php?cod_fest=<? echo "$cod[6]" ?>"><img height=112 width=120 border=0 src="foto_principal/<? echo "$foto_pri[6]" ?>"></a></div> </td> <td> <table width="100%" height="101" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="55"> <div align="center"><img height=43 src="foto_evento/<? echo "$foto_evento[6]"?>" width=100></div> </td> </tr> <tr> <td height="23"> <div align="center"><font color=#004080 size="2" face=Verdana, Arial, Helvetica, sans-serif><strong><small> <? echo "$descri[6]" ?> </small></strong></font></div> </td> </tr> <tr> <td height="23"> <div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> <? echo "$data[6]" ?> </font> - <font size="2"> <? echo "$dia_semana[6]" ?> </font></div> </td> </tr> </table> </td> <td><img name="q_r9_c4" src="barra/b_d_e/q_r2_c4.gif" width="1" height="140" border="0"></td> <td> <div align="center"><a href="fotos.php?cod_fest=<? echo "$cod[7]" ?>"><img height=112 width=120 border=0 src="foto_principal/<? echo "$foto_pri[7]" ?>"></a></div> </td> <td> <table width="100%" height="101" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="55"> <div align="center"><img height=43 src="foto_evento/<? echo "$foto_evento[7]"?>" width=100></div> </td> </tr> <tr> <td height="23"> <div align="center"><font color=#004080 size="2" face=Verdana, Arial, Helvetica, sans-serif><strong><small> <? echo "$descri[7]" ?> </small></strong></font></div> </td> </tr> <tr> <td height="23"> <div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> <? echo "$data[7]" ?> </font> - <font size="2"> <? echo "$dia_semana[7]" ?> </font></div> </td> </tr> </table> </td> <td><img name="q_r9_c7" src="barra/b_d_e/q_r2_c7.gif" width="10" height="140" border="0"></td> <td><img src="barra/b_d_e/spacer.gif" name="undefined_3" width="1" height="140" border="0"></td> </tr> <tr> <td><img name="q_r10_c1" src="barra/b_d_e/q_r10_c1.gif" width="12" height="8" border="0"></td> <td colspan="5"><img name="q_r10_c2" src="barra/b_d_e/q_r10_c2.gif" width="582" height="8" border="0"></td> <td><img name="q_r10_c7" src="barra/b_d_e/q_r10_c7.gif" width="10" height="8" border="0"></td> <td><img src="barra/b_d_e/spacer.gif" name="undefined_3" width="1" height="8" border="0"></td> </tr> </table> </td> </tr> </table><?php }mysql_free_result($rs);mysql_close($conexao);?> Compartilhar este post Link para o post Compartilhar em outros sites
void 1 Denunciar post Postado Novembro 11, 2003 isso nem é php é lógica de programação! <_< portanto vou te passar a lógica do negócio! <html><head><title>for with tatle | thevoiddesign</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body><table> <tr> <? $intCell = 8; for($i = 1; $i <= $intCell; $i++){ ?> <td> <img src="images/0190/img/<?=$i?>.gif"> </td> <? if($i%3==0){ ?></tr> <? }} ?></table></body></html> isso ta funcionado em http://teco.fcc.univap.br/~cc010115/table.php the void Compartilhar este post Link para o post Compartilhar em outros sites