Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

fsales_123

Horizontal php

Recommended Posts

Jeito que está o anuncio :

_anuncio_1.jpg

Jeito que eu quero deixar, Montagem:

_montagem.jpg

Codigo abaixo:

<?php   	if(@$_POST){			$sql = mysql_query("SELECT * FROM anuncios WHERE descricao LIKE '%".$_POST["query"]."%' ORDER BY ID DESC");	}else{ 		if(empty($_GET["categoria"])){			$sql = mysql_query("SELECT * FROM anuncios WHERE status = 'Ativo' AND ID ORDER BY RAND() LIMIT 10");		}else{			$sql = mysql_query("SELECT * FROM anuncios WHERE categoria = '".strip_tags($_GET["categoria"])."' AND status = 'Ativo' ORDER BY nome ASC");		}	}				if(mysql_num_rows($sql) == false){				echo '<div align="center"><br /><strong>Nenhum anúncio encontrado.</strong><br /></div>';			}else{				while($ln = mysql_fetch_object($sql)){	?>       <table width="100%" border="0">         <tr>           <td width="2%" height="110" align="center" valign="middle"><img src="uploads/<?php echo $ln->thumb; ?>" width="140" height="90" /></td>           <td width="98%" align="left" valign="top">           <div align="left" style="margin:5px; font-size:11px;"><?php echo truncate(strip_tags($ln->descricao), 150); ?>...</div>           <div align="left" style="margin:5px; font-size:11px;">Data: <strong><?php echo str_replace("-", "/", inverteData($ln->data)); ?></strong></div>           <div align="left" style="margin:5px; font-size:11px;">Enviado por: <strong><?php echo $ln->nome; ?></strong></div>           <div align="left" style="margin-left:5px; margin-top:10px;"><a href="javascript: ver_anuncio(<?php echo $ln->ID; ?>);" class="botao" style="text-decoration:none;">Ver anúncio</a></div>                      </td>         </tr>       </table>      	<?php 				}	   ?>      	<?php 			}	?>

me ajudem

 

 

quero deixar como coluna igual a segunda imagem! como faço?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tenta usar assim...

<?php 
 
 	if(@$_POST){
			$sql = mysql_query("SELECT * FROM anuncios WHERE descricao LIKE '%".$_POST["query"]."%' ORDER BY ID DESC");
	}else{
 
		if(empty($_GET["categoria"])){
			$sql = mysql_query("SELECT * FROM anuncios WHERE status = 'Ativo' AND ID ORDER BY RAND() LIMIT 10");
		}else{
			$sql = mysql_query("SELECT * FROM anuncios WHERE categoria = '".strip_tags($_GET["categoria"])."' AND status = 'Ativo' ORDER BY nome ASC");
		}
	}
	
			if(mysql_num_rows($sql) == false){
				echo '<div align="center"><br /><strong>Nenhum anúncio encontrado.</strong><br /></div>';
			}else{
				while($ln = mysql_fetch_object($sql)){
	?>
       <table style="width:auto; height:auto; float:left; margin-bottom:10px;" border="0">
         <tr>
           <td width="2%" height="110" align="center" valign="middle"><img src="uploads/<?php echo $ln->thumb; ?>" width="140" height="90" /></td>
           <td width="98%" align="left" valign="top">
           <div align="left" style="margin:5px; font-size:11px;"><?php echo truncate(strip_tags($ln->descricao), 150); ?>...</div>
           <div align="left" style="margin:5px; font-size:11px;">Data: <strong><?php echo str_replace("-", "/", inverteData($ln->data)); ?></strong></div>
           <div align="left" style="margin:5px; font-size:11px;">Enviado por: <strong><?php echo $ln->nome; ?></strong></div>
           <div align="left" style="margin-left:5px; margin-top:10px;"><a href="javascript: ver_anuncio(<?php echo $ln->ID; ?>);" class="botao" style="text-decoration:none;">Ver anúncio</a></div>
           
           </td>
         </tr>
       </table>
      
	<?php 
				}
	   ?>
      
	<?php 
			}
	?>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.