KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

How to pass multiple parameters and call the mysql stored procedure in koolreport php #2540

Open Komuraiah A opened this topic on on Jan 20, 2022 - 4 comments

Komuraiah A commented on Jan 20, 2022

Dear Team, I have implemented the code using mysql stored procedure in place of query.If i'm selecting the multiple values in multi select dropdown list it will not work. i am implented using single value selection and stored procedure it will work.please help me the code how to pass the multiple values in single parameter my sql stored procedure

Sebastian Morales commented on Jan 21, 2022

Pls post your code and how you passed your params for us to check it for you. Tks,

Komuraiah A commented on Jan 21, 2022

below is the code ,and passing multiple values in single parameter.

$this->src("xyz")
            ->query("CALL sp_test(@start:=:start , @end:=:end , @eid:=:eid)")
		    ->params(array(
                
				':eid'=>$this->params['eid'],
				":start"=>$this->params["dateRange"][0],
                               ":end"=>$this->params["dateRange"][1],
            ))
            ->pipe($this->dataStore("data"));

above code eid is the multiple select dropdown list.pls help me with code

Sebastian Morales commented on Jan 21, 2022

Since it's already our weekend, pls wait till after Saturday and Sunday. We will test this and come back to you with a solution early next week. Rgds,

Sebastian Morales commented on Jan 25, 2022

Can you pls try this stored procedure call:

            ->query("CALL sp_test(:start , :end , :eid)")
		    ->params(array(
                
				':eid'=>$this->params['eid'],
				":start"=>$this->params["dateRange"][0],
                               ":end"=>$this->params["dateRange"][1],
            )) 

You could assign the variable @start, @end, @eid inside the procedure itself. Let us know if there's any difficulty. Rgds,

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

Inputs