Ver Mensaje Individual
  #3 (permalink)  
Antiguo 02/01/2011, 22:49
vBArgentina
 
Fecha de Ingreso: octubre-2010
Ubicación: Mountain View, United States.
Mensajes: 87
Antigüedad: 13 años, 6 meses
Puntos: 1
Respuesta: [Ayuda] Enlistar resultados de una query

Tengo esta query:

Código PHP:
Ver original
  1. <?php
  2. require 'datos.php';
  3. // I use above file for security to provide below
  4. //----------------------------------------------
  5. $conn=mssql_connect($dbhost,$dbuser,$dbpasswd);
  6. $selected=mssql_select_db('MuOnline', $conn);
  7.  
  8. $query = 'select * From Character where Ctlcode= 8 order by Name desc';
  9. $result = mssql_query( $query );
  10. // This is pretty much your layout
  11. echo '<html>';
  12. echo "<head>\n";
  13. echo "<LINK REL='StyleSheet' HREF='style.css' TYPE='text/css'>\n";
  14. echo '<body>';
  15. echo '<font face=Arial; font-color:#000000;>';
  16. echo '<center><table border=0 cellSpacing=0 width=10 align=center class="Estilo11">';
  17.  
  18.  
  19. for($i=0;$i<mssql_num_rows($result);++$i)
  20. {
  21. $row = mssql_fetch_row($result);
  22. $querychar = "Select Name From Character where Ctlcode=8";
  23. $resultchar = mssql_query( $querychar );
  24. $accchar = mssql_fetch_row($resultchar);
  25. $querychar = "Select Name, Class, clevel, MapNumber From Character where Name='$accchar[0]'";
  26. $resultchar = mssql_query( $querychar );
  27. $charr = mssql_fetch_row($resultchar);
  28. echo '<tr><td  width=28><center><font face=Arial size=2>';
  29.  
  30. echo '<b></font></td><td  width=85><center><FONT SIZE=2 face=Arial font color=red><b><table style="filter:glow(color=blue,strength=1)">';
  31.  
  32. echo '<strong></font></table></td><td  width=85 class="Estilo11" font-weight: Bold;><center></strong>';
  33. echo $resultchar[8];
  34. echo '</b></font></td><td  width=130><center><font face=Arial size=2>';
  35. echo '<tr><td  height=1></td><td ></td><td </td><td </td><td <td ';
  36. }
  37. echo '<tr><td  height=10></td><td ></td><td ></td><td ></td><td ></td><td ></td><td ></td>';
  38. echo '</table>';
  39. echo '</body>';
  40. echo '</html>';
  41.  
  42. echo '<br><br>';
  43. echo '<center><font face=Arial size=2></font></center>';
  44. echo '</b><br>';
  45.  
  46. $conn=mssql_close();
  47. ?>





Esa query no la arme yo.
Estaba en un .PHP y la edite un poco
porque cumplia casi la misma funcion que yo queria y no podia conseguir.

Si tienen alguna query que me sirva exactamente y que no hagan tanto "despelote" como esta, les agradeceria.