Ver Mensaje Individual
  #3 (permalink)  
Antiguo 14/11/2010, 14:25
tazzwt
 
Fecha de Ingreso: marzo-2010
Mensajes: 432
Antigüedad: 14 años, 1 mes
Puntos: 11
Respuesta: Como en listar 3 columnas Php MySQL

muchas gracias santris funciona perfecto queda super dinamico. no se me ocurrio nunca esa solucion. te admiroo profundamente


yo lo estaba creando asi, pero no quedaba dinamico y se repite mucho el codigo. tu codigo es espectacular.

Código PHP:
Ver original
  1. <?php
  2.    include("conex.php");
  3.    $link=Conectarse();  
  4.    
  5.     echo "Total es: $totales registros<br>";
  6.     echo "<table width='500' height='103' border='1' cellpadding='1' cellspacing='1'>
  7.     <tr>
  8.     ";
  9.  
  10.     $sql = "SELECT SQL_CALC_FOUND_ROWS * FROM titulos LIMIT 0, 3";
  11.     $result=mysql_query($sql,$link);
  12.     $totales = mysql_num_rows($result);
  13.  
  14.     while($row = mysql_fetch_array($result)) {
  15.      
  16.         $id = $row["id"];
  17.         echo "<td>Id: $id </td>";    
  18.     }
  19.  
  20.     echo "<tr>";
  21.  
  22.  
  23.     $sql = "SELECT SQL_CALC_FOUND_ROWS * FROM titulos LIMIT 3, 3";
  24.     $result=mysql_query($sql,$link);
  25.     $totales = mysql_num_rows($result);
  26.  
  27.     while($row = mysql_fetch_array($result)) {
  28.      
  29.         $id = $row["id"];
  30.         echo "<td>Id: $id</td>";    
  31.     }
  32.  
  33.     echo "<tr>";
  34.  
  35.     $sql = "SELECT SQL_CALC_FOUND_ROWS * FROM titulos LIMIT 6, 3";
  36.     $result=mysql_query($sql,$link);
  37.     $totales = mysql_num_rows($result);
  38.  
  39.     while($row = mysql_fetch_array($result)) {
  40.      
  41.         $id = $row["id"];
  42.         echo "<td>Id: $id</td>";    
  43.     }
  44.  
  45.     echo "<tr>";
  46.  
  47.  
  48. echo " </tr> </table>";
  49. ?>

salida es: