Menu

 
Reply to this topicStart new topic
> [PHP] registos | 3 por linha
V
XsTeAl
post Jul 23 2008, 11:00 AM
Post #1




Grupo: Membro
Posts: 645
Registado: 25-November 06
De: Perulheira
Membro nº: 5,713



Boas, tou a desenvolver um catalogo online para uma empresa, no qual ao mostras os layouts, pediram-me para mostrar layouts 3 por linha como exemplo vou mostrar:

---lyaout1----layout2---layout3-----
---layout4----layout5---layout6-----

a mostrar os layouts, tou a mostrar tudo seguido com um select na tabela e mostrar no while ou seja queria implementar esse codigo no while, se alguem me podesse dar umas luzes, agradecia.

:?
Go to the top of the page
 
+Quote Post
Kugas
post Jul 24 2008, 03:44 PM
Post #2




Grupo: Membro
Posts: 46
Registado: 17-December 07
Membro nº: 18,577



Mostra como é que tens o codigo!?.... se o tiveres


Cumprimentos...
Go to the top of the page
 
+Quote Post
XsTeAl
post Jul 24 2008, 07:09 PM
Post #3




Grupo: Membro
Posts: 645
Registado: 25-November 06
De: Perulheira
Membro nº: 5,713



ja fiz soz, ja poderia ter posto aqui... mas se quiserem posso mostrar como fiz...
Go to the top of the page
 
+Quote Post
Kugas
post Jul 24 2008, 08:29 PM
Post #4




Grupo: Membro
Posts: 46
Registado: 17-December 07
Membro nº: 18,577



força... ja agr smile.gif
Go to the top of the page
 
+Quote Post
XsTeAl
post Jul 29 2008, 01:26 PM
Post #5




Grupo: Membro
Posts: 645
Registado: 25-November 06
De: Perulheira
Membro nº: 5,713



fiz assim:

$a=0;

$splitAt=4;



while($layout=mysql_fetch_array($sql)){

$a++;



$nomelay = $layout[nome];

$vd_sql = mysql_query("SELECT * FROM vd WHERE nome_lay = '$nomelay'");

$vdtotal = mysql_num_rows($vd_sql);



$str.='<div class="layouts" align="center">

<div align="center"><a href="images/layouts/grandes/'.$layout[imagem].'" rel="lightbox" title='.$layout[nome].'><img src="images/layouts/thumb/'.$layout[imagem].'"></a></div>

<div align="left"><strong>&nbsp;Nome: <a href="index.php?c=layouts&layout='.$layout[nome].'">'.$layout[nome].'</a></strong><br><strong>&nbsp;Código:</strong> '.$layout[data].''.$layout[preco].'"X"'.$layout[id].'<br><strong>&nbsp;Categoria:</strong> '.$layout[categoria].'<br><strong>&nbsp;Vd:</strong> <a href="index.php?c=vd&layout='.$layout[nome].'">'.$vdtotal.'</a><br></div>

</div>';

  $str.=($a%$splitAt!=0)?"":"<br>";



}

echo $str;
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

 

Publicidade
who's online
Versão Simples
Skin by IPB Customize
Horário: 3rd December 2008 - 05:55 AM