Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/01/2014, 13:19
JorgeQuirino
 
Fecha de Ingreso: enero-2014
Mensajes: 111
Antigüedad: 10 años, 2 meses
Puntos: 1
error mysql_num_rows () cuando ejecuto el php

Código PHP:
Ver original
  1. <?php
  2.  
  3. $c=mysql_connect('localhost','root','');
  4. mysql_select_db('automatizacion');
  5.  
  6.  
  7. $r=mysql_query("select `ID`,
  8. `Origen`,
  9. `Sistema Afectado / IP`,
  10. `Codigo`,
  11. `Nombre`,
  12. `Detalle debilidad`,
  13. `Impacto`,
  14. `Recomendación`,
  15. `Tipo (APP-SInfraestrcutura)`,
  16. `Criticidad (A-M-B)`,
  17. `Exposición`,
  18. `Area`,
  19. `Responsable`,
  20. `Fecha de inicio`,
  21. `Periodo`,
  22. `Plazo (semanas)`,
  23. `Fecha de cierre`,
  24. `Estado`,
  25. `Acciones`,
  26. `Comentarios`,
  27. `NUEVO ESTADO`
  28. FROM `respaldo(seguimientovulnerabili`");
  29.  
  30. if($d>0)
  31. {   header ('Content-type: application/vnd.ms-excel');
  32.     header ('Content-Disposition: attachment;filename=archivoRacf.xls');   
  33.     header ('Pragma: no-cache');
  34.     header ('Expires: 0');
  35.  
  36.     echo ("<table border= 1 >");
  37.     echo ("<tr>");
  38.     echo ("<td>ID</td>");
  39.     echo ("<td>Origen</td>");
  40.     echo ("<td>Sistema Afectado / IP</td>");
  41.     echo ("<td>Codigo</td>");  
  42.     echo ("<td>Nombre</td>");
  43.     echo ("<td>Detalle debilidad</td>");
  44.     echo ("<td>Impacto</td>");
  45.     echo ("<td>Recomendación</td>");
  46.     echo ("<td>Tipo (APP-SInfraestrcutura)</td>");
  47.     echo ("<td>Criticidad (A-M-B)</td>");
  48.     echo ("<td>Exposición</td>");
  49.     echo ("<td>Area</td>");
  50.     echo ("<td>Responsable</td>");
  51.     echo ("<td>Fecha de inicio</td>");
  52.     echo ("<td>Periodo</td>");
  53.     echo ("<td>Plazo (semanas)</td>");
  54.     echo ("<td>Fecha de cierre</td>");
  55.     echo ("<td>Estado</td>");
  56.     echo ("<td>Acciones</td>");
  57.     echo ("<td>Comentarios</td>");
  58.     echo ("<td>NUEVO ESTADO</td>");
  59.     echo ("</td>");
  60.  
  61.  
  62. while ($registro=mysql_fetch_row($r)){
  63.  
  64.  
  65.     echo ("<tr>");
  66.     echo ("<td>$registro[0]</td>");
  67.     echo ("<td>$registro[1]</td>");
  68.     echo ("<td>$registro[2]</td>");
  69.     echo ("<td>$registro[3]</td>");
  70.     echo ("<td>$registro[4]</td>");
  71.     echo ("<td>$registro[5]</td>");
  72.     echo ("<td>$registro[6]</td>");
  73.     echo ("<td>$registro[7]</td>");
  74.     echo ("<td>$registro[8]</td>");
  75.     echo ("<td>$registro[9]</td>");
  76.     echo ("<td>$registro[10]</td>");
  77.     echo ("<td>$registro[11]</td>");
  78.     echo ("<td>$registro[12]</td>");
  79.     echo ("<td>$registro[13]</td>");
  80.     echo ("<td>$registro[14]</td>");
  81.     echo ("<td>$registro[15]</td>");
  82.     echo ("<td>$registro[16]</td>");
  83.     echo ("<td>$registro[17]</td>");
  84.     echo ("<td>$registro[18]</td>");
  85.     echo ("<td>$registro[19]</td>");
  86.     echo ("<td>$registro[20]</td>");
  87.    
  88.     echo ("</td>");
  89.  
  90. }
  91. echo ("</table>");
  92.  
  93. }
  94.  
  95. else{
  96. echo ("no ahi registros");
  97. }
  98.  
  99.  
  100. ?>

me lanza el error en la linea 30 ($d=mysql_num_rows($r);)

y nose que pueda estar mal, ya que realice lo mismo con otra tabla mas pequeña y sale sin errores. Eso Saludos y Gracias