Hi, here is the code. I however was hoping that you could give me some ideas on how I could find out myself what's wrong with a query when the prepareAndBind fails to create the $stmt object. Is there maybe something like a validation function that I could call which can indicate where there is an error in the query ?
[](
public function setup()
{
// get input parameters
$NbrDays = request()->get('NbrDays');
$Agentid = request()->get('AgentId');
// build detailled datatable
$this->src('uhh')->query (
'SELECT count(gtp_trip_id) as NbrTrips,
agent_identifier,
customer_code,
corporation_id,
date(created_at)as CDate,
source_system
FROM '.config('koolreport.uhhdata.database').'.trips
where date(created_at)> (date(now())-('.intval($NbrDays).'+1))
and agm_status = "done"
and agent_identifier like "'.$Agentid.'"
group by agent_identifier,customer_code,corporation_id,gtp_trip_id,date(created_at),agm_status,source_system;'
)
->pipeTree(
function($node) // build detailled listing
{
$node->pipe($this->dataStore('Details') );
},
function($node) // build trip count list per day
{
$node->pipe(new OnlyColumn(array("agent_identifier","NbrTrips","CDate","source_system")))
->pipe(new Group(array(
"by"=>array("agent_identifier","CDate","source_system"),
"sum"=>array("NbrTrips")
)))
->pipe($this->dataStore('TripsPerDay'));
},
);
})