$ProcuctionEntriesDbs=array("3b2book","3b2journal","cebook","cejournal","dataconversionbook","dataconversionjournal","dataentrybook","dataentryjournal","epubbook","graphicsbook","graphicsjournal","jobanalysisbook","jobanalysisjournal","paginationbook","prepressbook","prepressjournal","proofreaderbook","proofreaderjournal","scannedepubbook","tebook","tejournal","texbook","xmljournal","xmlbook","ftpbook","ftpjournal");
$MyProdQuery="";
for($x=0;$x<sizeof($ProcuctionEntriesDbs);$x++)
{
$MyProdQuery.="(SELECT jobnoprefix,jobnosufix,journalname,enickid,eid,ename,fromtime,totime,duration,fn,process,minutes,date,time,noofpages,endpage,totalpage,remarks,articleid,platform from ".$ProcuctionEntriesDbs[$x]." where eid='".$eid."' and str_to_date(date, '%d/%m/%Y')>=str_to_date('".$fromdate1."', '%d/%m/%Y') and str_to_date(date, '%d/%m/%Y')<=str_to_date('".$todate1."', '%d/%m/%Y')) ";
if($x<sizeof($ProcuctionEntriesDbs)-1)
{
$MyProdQuery.=" UNION ";
}
}
$MyProdQuery.=" order by time ASC";
How to write the above query in koolreport ....