Tema: select php
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 09/02/2011, 21:44
walterdevel
 
Fecha de Ingreso: diciembre-2010
Mensajes: 788
Antigüedad: 13 años, 4 meses
Puntos: 51
Respuesta: select php

Algo así sería:

Código PHP:
Ver original
  1. <?php
  2.  $conexion = mysql_connect("localhost", "root", "") or die("Problemas en la conexion");
  3. mysql_select_db("nombrebase", $conexion) or die ("Problema al seleccionar bd");
  4.  
  5.  
  6.  
  7. $strselect="SELECT titulos,parrafos FROM home WHERE onn = '1' ORDER BY id ASC";
  8. $resultado=mysql_query($strselect,$conexion);
  9. $i = 0;
  10. while($fila=mysql_fetch_array($resultado)){
  11. $vari = $fila['titulos'];
  12. $i++;
  13. ?>
  14. <div id="<?php echo $i;?>"><?php echo $vari?></div>
  15. <?
  16. }
  17. ?>