Ver Mensaje Individual
  #5 (permalink)  
Antiguo 03/01/2012, 09:55
lizz17_87
 
Fecha de Ingreso: febrero-2011
Mensajes: 38
Antigüedad: 13 años, 2 meses
Puntos: 1
Respuesta: porqué me sale este error en esta consulta Warning: mysql_fetch_assoc() ex

//ESTA ES LA FUNCION COMPLETA CREO QUE ASI COMO LO PUSE PRIMERO LA CONSULTA Y DESPUES LA MYSQL_FETCH_ASSOC// PORFAVOR AYUDENME


function buscarExpediente() {
$numeroExpediente = $_POST['numeroExpediente'];
if ($numeroExpediente!="") {
$consulta = mysql_query("Select numeroExpediente,ciBeneficiario,nombreBeneficiario , idMunicipios,nombreRubro,plazo,condicion,asistenci aTecnica,tipoFondoRiesgo,montoFondoRiesgo,imprevis to,has,montoAprobado,DATE_FORMAT(fechaVcto,'%Y/%m/%d') as fechaVcto,pPartida,DATE_FORMAT(fechapPartida,'%Y/%m/%d') as fechapPartida,sPartida, DATE_FORMAT(fechasPartida,'%Y/%m/%d') as fechasPartida, tPartida, DATE_FORMAT(fechatPartida,'%Y/%m/%d') as fechatPartida From exp Where numeroExpediente = '$numeroExpediente'")or die(mysql_error());;
if ($registro=mysql_fetch_assoc($consulta)) {

$query = mysql_query("SELECT a.numeroExpediente, a.fechaDesde, a.fechaHasta, a.dias, a.monto, a.interesOrdinario, a.interesLuegoVcto, a.interesMoratorio, b.fechaVcto, DATEDIFF(b.fechaVcto,a.fechaHasta) AS fechaV FROM detalleliquidaciones a, exp b WHERE a.numeroExpediente = b.numeroExpediente");
$int_tv=0;
while ($rec=mysql_fetch_assoc($query)) {
$fechaV = $rec[9];
if ($fechaV<0){
$interesV = $rec[4]*($fechaV/360)*0.0869;
$interesM = $rec[4]*($fechaV/360)*0.03;
}else{
$interesV = 0;
$interesM = 0;
}
$rec['interesV']= $interesV;
$rec['interesM']= $interesM;

$int_tv=$int_tv+$rec['interesV'];

//$sal[]=$rec['interesV']."-".$rec['interesM']."-".$int_tv;
}

$salida = $registro['numeroExpediente']."|".$registro['ciBeneficiario']."|".$registro['nombreBeneficiario']."|".$registro['idMunicipios']."|".$registro['nombreRubro']."|".$registro['plazo']."|".$registro['condicion']."|".$registro['asistenciaTecnica']."|".$registro['tipoFondoRiesgo']."|".$registro['montoFondoRiesgo']."|".$registro['imprevisto']."|".$registro['has']."|".$registro['montoAprobado']."|".$registro['fechaVcto']."|".$registro['pPartida']."|".$registro['fechapPartida']."|".$registro['sPartida']."|".$registro['fechasPartida']."|".$registro['tPartida']."|".$registro['fechatPartida'];

echo $salida;
//echo $sal;
} else {
echo "{failure:true}";
}
} else {
echo "{failure:true}";
}
}