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

Cita:
Iniciado por pateketrueke Ver Mensaje
yo lo único que veo es que falta un punto-y-coma al final de aquí...


si necesitas algunas balas yo te presto...
*********************************************
Si esta puuesta el punto y coma y cuando lo corro..sale:
Parse error: syntax error, unexpected T_VARIABLE, expecting T_WHILE in C:\secretariag\reporte\re2.php on line 25
apunta a esto:
$newvar=mysql_fetch_assoc($consultarepor);

//////////////////////// ahi va el codigo /////////////// x si aca //////////

<?php require_once('../Connections/conexion.php'); //movemos el archivo de conexiones hasta arriba ?>

<table border="1" cellpadding="1" cellspacing="1">

<tr>
<td>ntramite</td>
<td>fecing</td>
<td>interesado</td>
<td>asuning</td>
<td>desres</td>
</tr>

<?php do { ?>

<tr>
<td><?php echo $row_consultarepor['ntramite']; ?></td>
<td><?php echo $row_consultarepor['fecing']; ?></td>
<td><?php echo $row_consultarepor['interesado']; ?></td>
<td><?php echo $row_consultarepor['asuning']; ?></td>
<td><?php echo $row_consultarepor['desres']; ?></td>
</tr>

<?php }

$newvar=mysql_fetch_assoc($consultarepor);
//creamos una nueva variabnle almacenando el resultado del array

while ($row_consultarepor = $newvar); ?>

</table>

<?php

if (!function_exists("GetSQLValueString")) {

function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

{

if (PHP_VERSION < 6) {

$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

}



$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);


switch ($theType) {
case "text":

$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":

$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":

$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}

return $theValue;

}

}



$maxRows_consultarepor = 10;

$pageNum_consultarepor = 0;

if (isset($_GET['pageNum_consultarepor'])) {

$pageNum_consultarepor = $_GET['pageNum_consultarepor'];

}

$startRow_consultarepor = $pageNum_consultarepor * $maxRows_consultarepor;



mysql_select_db($database_conexion, $conexion);

$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";

$query_limit_consultarepor = sprintf("%s LIMIT %d, %d", $query_consultarepor, $startRow_consultarepor, $maxRows_consultarepor);

$consultarepor = mysql_query($query_limit_consultarepor, $conexion) or die(mysql_error());

$row_consultarepor = mysql_fetch_assoc($consultarepor);



if (isset($_GET['totalRows_consultarepor'])) {

$totalRows_consultarepor = $_GET['totalRows_consultarepor'];

} else {

$all_consultarepor = mysql_query($query_consultarepor);

$totalRows_consultarepor = mysql_num_rows($all_consultarepor);

}

$totalPages_consultarepor = ceil($totalRows_consultarepor/$maxRows_consultarepor)-1;



mysql_free_result($consultarepor);

?>