Ver Mensaje Individual
  #8 (permalink)  
Antiguo 16/06/2011, 23:13
Avatar de memoadian
memoadian
Colaborador
 
Fecha de Ingreso: junio-2009
Ubicación: <?php echo 'México'?>
Mensajes: 3.696
Antigüedad: 15 años, 2 meses
Puntos: 641
Respuesta: Numeros aleatorios, en cuadros

No pues si andas perdido, y yo cansado asi que

Código PHP:
Ver original
  1. $con = mysql_connect('localhost', 'user', 'pass');
  2. $bd = mysql_select_db($database_AnunciosWeb) or die ("Verifique la Base de Datos");
  3. $sql = 'SELECT DISTINCT id FROM anuncios WHERE activo=1 ORDER BY RAND()';
  4. $result = mysql_query($sql, $con);
  5. $i = 1;
  6. echo '<table>';
  7. while ($row_Consulta1 = mysql_fetch_array($result)) {
  8.     if ($i == 1 || ($i - 1) % 4 == 0) {
  9.         echo '<tr>';
  10.     }
  11.     echo '<td>'.$row_Consulta1['id']. '</td>';
  12.     if ($i % 4 == 0) {
  13.         echo '</tr>';
  14.     }
  15.     $i++;
  16. }
  17. echo '</table>';

solo sustituye los valores en mysql_connect y mysql_select_db

te servirá para entender.