global $adb;
$sql = 'SELECT * from vtiger_invoice where invoiceid = ?';
$result = $adb->pquery($sql,array($_REQUEST['record']));
$fecha=$adb->query_result($result,$i,'invoicedate');
for($i=0;$i<sizeof($vencimientos);$i++)
{
$date[$i] = date_create($fecha);
date_add($date[$i], date_interval_create_from_date_string($periodicidad.' days'));
$fechafinal = explode(" ",$date[$i]->date);
$splitdate = explode("-",$fechafinal[0]);
$reversedate = array_reverse($splitdate);
$fechafinal = implode("-",$reversedate);
$pdf->MultiCell(100, $summaryCellHeight , $fechafinal, '', 'L', 0, 1, $summaryLineX+135, $summaryLineY);
$summaryLineY += 4;
}
The problem is this code dont works, or at least $fechafinal didnt get value. When im debugging, all works 100% but when i execute dont works.
I tried put 'sleeps' but dont works too.
What can i do? This is strange because i cant find error because when im debugging all works :/
$fecha=$adb->query_result($result,$i,'invoicedate');