Ver Mensaje Individual
  #3 (permalink)  
Antiguo 25/10/2011, 09:05
Avatar de pampa_
pampa_
 
Fecha de Ingreso: mayo-2006
Mensajes: 334
Antigüedad: 18 años, 1 mes
Puntos: 1
Respuesta: boton carga consulta en un div

gracias pero se me habia olvidado postear esa parte, pero gracias....

esto es lo que hay
Código PHP:
Ver original
  1. $link = mysql_connect("****.*****.com", "++++_*****", "****");
  2.                 mysql_select_db("***********", $link);
  3.                
  4.                 $filtro='';
  5.                
  6.                 $provincia=$_POST['sprovincia'];
  7.                                
  8.                 echo "$provincia";
  9.                
  10.                
  11.                 if($provincia!="-seleccione provincia-"){
  12.                     $filtro="provincia=\"$provincia\"";
  13.                 }
  14.                    
  15.        
  16.                 $result = mysql_query("SELECT * FROM anuncios WHERE $filtro", $link);
  17.                
  18.                 // CODIGO PARA BUSCAR SI HAY UN ERROR EN LA CONSULTA
  19.                 $error = mysql_error($link);  // $link es la variable de conexión
  20.                    
  21.                 if ($error!=null)
  22.                 {
  23.                     print("Ocurrio; el Siguiente Error:\n ".$error);
  24.                     exit;
  25.                 }
  26.                 // FIN DE LA BUSQUEDA DE ERROR
  27.                            
  28.                 //echo "<table border = '1'> \n";
  29.                 //echo "<tr> \n";
  30.                
  31.                
  32.                 /*
  33.                 for ($i = mysql_num_rows($result) - 1; $i >= 0; $i--) {
  34.                     if (!mysql_data_seek($result, $i)) {
  35.                         echo "No se encuenta la fila $i:\n";
  36.                         continue;
  37.                     }
  38.  
  39.                     if (!($row = mysql_fetch_assoc($result))) {
  40.                         continue;
  41.                     }
  42.  
  43.                     echo $row['id'] . ' ' . $row['tipo'] . "<br />\n";
  44.                 }*/
  45.                
  46.                 echo '<table align="center" border="0" cellpadding="5px" cellspacing="0" width="500">';
  47.  
  48.                 $contador =1;
  49.                 $num_col=3;
  50.            
  51.                 echo "<tr>";
  52.            
  53.                 while ($row = mysql_fetch_row($result)){
  54.                     $trans=array("&ntilde"=>"ñ"); //funcion para poder mostrar las ñ que en mysql son &ntilde
  55.                     $row[4]=strtr($row[4],$trans);
  56.                     $row[6]=strtr($row[6],$trans);
  57.                     echo '<td align="left">';
  58.                    
  59.                     //echo "<a href=http://google.es onclick=return false><img src='$row[5]'></img></a> <br>";
  60.                     //echo "<a href='javascript:Recuperar()' name='recuperarAjax'>Registrese</a>";
  61.                     ?>
  62.                     <!-- FUNCIONA <a href="javascript:ajaxpage('external.htm', 'menu-izq');">Porsche Page</a>-->
  63.                     <?php
  64.                           //echo "<img src='$row[5]'></img> <br>";
  65.                     ?>
  66.                      
  67.                    
  68.                     <!--<script type="text/javascript">
  69.                         $('a').click(function(){
  70.                             $('#main').load('externa.htm');
  71.                         });
  72.                     </script>
  73.                     -->
  74.    
  75.                     <!-- FUNCIONA <input name="bt1" type="button" value="CARGA CONTENIDO" class="boton"/>-->
  76.                     <?php echo "<img src='$row[4]'></img>";?>
  77.                     <?php
  78.                     //echo "<b>Enlace:</b> $row[6] <br>";
  79.                    
  80.                     echo "<br><b>Localidad:</b> $row[8] <br>";
  81.                     echo "<b>Marca:</b> $row[9] <br>";
  82.                     echo "<b>Gestión:</b> $row[17] <br>";
  83.                     echo "<b>Precio:</b> $row[15] <br>";
  84.                     echo "</td>";
  85.            
  86.                     if ($contador == $num_col){
  87.                         echo "</tr><tr>";
  88.                         $contador=0;
  89.                     }
  90.                     $contador++;
  91.                 }
  92.          
  93.                 //terminar de rellenar tabla con celdas...
  94.          
  95.                 if ($contador < $num_col){
  96.                     $celdas_falt=$num_col - $contador;
  97.                     while ($celdas_falt <= $num_col){
  98.                         echo "<td>$nbsp</td>";
  99.                         $celdas_falt++;
  100.                     }
  101.                 echo "</tr>";
  102.                 }
  103.                 echo '</table>';