Ver Mensaje Individual
  #7 (permalink)  
Antiguo 09/01/2013, 12:41
xoceunder
 
Fecha de Ingreso: junio-2012
Ubicación: En el Mundo
Mensajes: 759
Antigüedad: 11 años, 10 meses
Puntos: 10
Respuesta: duda en poder hacer que continue en otro tr en la tabla

pero haora con el if si hay una sola pelicula no la muestra cuando muestra es cuando hay mas de 2

Código PHP:
Ver original
  1. <?php
  2. $columnas = 5;
  3. $filas = 4; // OK?
  4.  
  5. // luego, para facilitar esto usaremos dos for() anidados
  6.  
  7.  
  8. for ($x = 0; $x < $filas; ++$x)
  9. {
  10.  
  11.   // "vector" X
  12.   echo '<tr>';
  13.  
  14.   for ($y = 0; $y < $columnas; ++$y)
  15.   {
  16.      echo "<td width=\"25%\" valign=\"top\" bgcolor=\"#ffffff\" align=\"center\" onmouseout=\"this.style.background='#ffffff'\" onmouseover=\"this.style.background='#F5F5F5'\" style=\"background: none repeat scroll 0% 0% rgb(255, 255, 255);\">";
  17.     if ($row_list_movie_center = mysql_fetch_assoc($list_movie_center)) {
  18.     // rutinas....
  19.     echo "<table cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#C0C0C0\" border=\"1\" bgcolor=\"#EFEFEF\" style=\"border-collapse: collapse\" id=\"table41\">
  20.                                         <tr>
  21.                                             <td><a href=\"Bad+Taste-493.htm\"><img width=\"100\" vspace=\"2\" hspace=\"2\" border=\"0\" style=\"border: 1px solid #C0C0C0\" src=\"images/film/".$row_list_movie_center["image"]."\"></a></td>
  22.                                         </tr>
  23.                                     </table>
  24.                                     <p style=\"margin-top: 5px; margin-bottom: 0\"> <b>".$row_list_movie_center["title"]."</b></p>
  25.                                     <p style=\"margin-top: 0; margin-bottom: 0\">
  26.                                     <a href=\"movie-type-2.htm\"><font color=\"#800000\">
  27.                                     Category</font></a>: <a href=\"movie-category-14.htm\"><font color=\"#800000\">SCI-FI</font></a></p>
  28.                                     <p style=\"margin-top: 0; margin-bottom: 6px\">
  29.                                     # Views: ".$row_list_movie_center["view"]."
  30.                                 </p>";
  31.    
  32.     }
  33.      echo '</td>';
  34.   }
  35.   // cerramos X
  36.   echo '</tr>';
  37. }
  38. ?>