Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
I can't seem to find distinct function so here is my attempt but it still doesn't work neither does it look efficient:
$this->src("config")->query("select * from history")
->pipe(new Filter(array(
array("`Date`","<",$date_val)
)))
->pipe(new Group(array(
"by"=>array("SID"),
"count"=>array("SID")
)))
->pipe($this->dataStore("checkedsm"));
I think the simplest way is to use the original sql query together with parameter binding to avoid sql injection:
$this->src('config')
->query("select count(distinct(SID)) from history where `Date` < :dateVal")
->params(array(
":dateVal" => $dateval
))
->pipe($this->dataStore("checkedsm"));
If you'd like to use KoolReport's query builder let us know. Thanks!
Thanks, this now works with
":dateval" => "2020-08-19"
but what you have above returns null. So it's back to the problem here.
Not sure how to print out the contents of row["Date"] asides generating a table.
Ok, found a way.
$dateval was set outside the class (this is all using singlepage option.)
When I now set within the class:
protected $dateval = "2020-08-19";
and then
->params(array(":dateVal" => $this->dateval...
It works.
Thank you.
Ps. I suppose the instantiated class doesn't have access to the global scope.
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo