Ver Mensaje Individual
  #6 (permalink)  
Antiguo 31/03/2011, 10:08
jonvel00
 
Fecha de Ingreso: diciembre-2010
Mensajes: 40
Antigüedad: 13 años, 5 meses
Puntos: 0
Respuesta: Problemas en While en PHP ayudar muvhas Gracias

Cita:
Iniciado por Aaronus23 Ver Mensaje
Prueba Asi:

Código PHP:
Ver original
  1. <?php require_once('../Connections/conexion.php'); //movemos el archivo de conexiones hasta arriba ?>
  2. <table border="1" cellpadding="1" cellspacing="1">
  3. <tr>
  4. <td>ntramite</td>
  5. <td>fecing</td>
  6. <td>interesado</td>
  7. <td>asuning</td>
  8. <td>desres</td>
  9. </tr>
  10. <?php do { ?>
  11. <tr>
  12. <td><?php echo $row_consultarepor['ntramite']; ?></td>
  13. <td><?php echo $row_consultarepor['fecing']; ?></td>
  14. <td><?php echo $row_consultarepor['interesado']; ?></td>
  15. <td><?php echo $row_consultarepor['asuning']; ?></td>
  16. <td><?php echo $row_consultarepor['desres']; ?></td>
  17. </tr>
  18. <?php }
  19. $newvar=mysql_fetch_assoc($consultarepor) /*creamos una nueva variabnle almacenando el resultado del array*/
  20.  while ($row_consultarepor = $newvar); ?>
  21. </table>
  22. <?php
  23. if (!function_exists("GetSQLValueString")) {
  24. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  25. {
  26. if (PHP_VERSION < 6) {
  27. $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  28. }
  29.  
  30. $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  31.  
  32. switch ($theType) {
  33. case "text":
  34. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  35. break;
  36. case "long":
  37. case "int":
  38. $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  39. break;
  40. case "double":
  41. $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  42. break;
  43. case "date":
  44. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  45. break;
  46. case "defined":
  47. $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  48. break;
  49. }
  50. return $theValue;
  51. }
  52. }
  53.  
  54. $maxRows_consultarepor = 10;
  55. $pageNum_consultarepor = 0;
  56. if (isset($_GET['pageNum_consultarepor'])) {
  57. $pageNum_consultarepor = $_GET['pageNum_consultarepor'];
  58. }
  59. $startRow_consultarepor = $pageNum_consultarepor * $maxRows_consultarepor;
  60.  
  61. mysql_select_db($database_conexion, $conexion);
  62. $query_consultarepor = "SELECT ingreso.ntramite, ingreso.fecing, ingreso.interesado, ingreso.asuning, estado_resolu.desres FROM ingreso, estado_resolu WHERE ingreso.idper = 1 AND ingreso.codres = estado_resolu.codres";
  63. $query_limit_consultarepor = sprintf("%s LIMIT %d, %d", $query_consultarepor, $startRow_consultarepor, $maxRows_consultarepor);
  64. $consultarepor = mysql_query($query_limit_consultarepor, $conexion) or die(mysql_error());
  65. $row_consultarepor = mysql_fetch_assoc($consultarepor);
  66.  
  67. if (isset($_GET['totalRows_consultarepor'])) {
  68. $totalRows_consultarepor = $_GET['totalRows_consultarepor'];
  69. } else {
  70. $all_consultarepor = mysql_query($query_consultarepor);
  71. $totalRows_consultarepor = mysql_num_rows($all_consultarepor);
  72. }
  73. $totalPages_consultarepor = ceil($totalRows_consultarepor/$maxRows_consultarepor)-1;
  74.  
  75. mysql_free_result($consultarepor);
  76. ?>


si esto no te funciona... podrias intentar cambiar el while por un for

mijo********************************************** ***************
su codigo da un error
Parse error: syntax error, unexpected T_VARIABLE, expecting T_WHILE in C:\secretariag\reporte\re2.php on line 25
************************************************** **************
esta dando el error en la declaracion de la variable
$newvar=mysql_fetch_assoc($consultarepor) /*creamos una nueva variabnle
************************************************** **************

Ya mismo me pego un tiro q no puedo solucionar eso..