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

(Buenas tengo un Problema estoy haciendo una buqueda que de acuerdo al usuario seleccionado en el combo me haga una consulta para saber quien ingreso ese tramite $valper) esa parte si me funciona y lo envio a operacion.php para despues hacer una consulta de acuerdo al id quien lo ingreso,
La consulta la ejecute en query browser y el mismo progrAma de dreamweaver y si funciona COMO PRUEBA LE ESCRIBO DESPUES DEL WHERE Q SEA = 1 es decir usuario abc para hacer la prueba

De hecho en dreamweaver cuando creo el juego de registro para despues hacerlo por medio de tabla dinamica, no me da problema;
ME DA PROBLEMA AL MOMENTO DE EJECUTARLO

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\secretariag\reporte\re2.php on line 17
ntramite fecing interesado asuning desres

*********************AQUI ESTA EL CODIGO**************************

<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 } while ($row_consultarepor = mysql_fetch_assoc($consultarepor)); ?>
</table>
<?php require_once('../Connections/conexion.php'); ?>
<?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);
?>
<?php /*?> hasta aqui esta todo bien <?php */?>


************************FIN DE CODIGO****************************

EL Problema apunta en el WHILE ESTA DANDO PROBLEMA EN ESA CONDICION QUISIERA QUE HAGAN EL FAVOR DE COMO MODIFICAR PARA QUE SE EjeCUTE ESA CONSULTA

pOR QUE SI ARRASTRO DEL JUEGO DE REGISTRO los parametros q seleccione a mostrar si lo hace, pero solo el primer registro (x eso digo el problema esta en el while
.................................................. .................................................. ..............................
Warning: mysql_fetch_assoc(): 4 is not a valid MySQL result resource in C:\secretariag\reporte\re2.php on line 65


Numero de Tramite Fecha de Ingreso Interesado Asunto de Ingreso Descripcion de la Resolucion
1 2011-03-16 gus la dolorosa En Espera


AGRADECIDO POR TODO LO QUE HE APRENDIDO..