php - I'm getting an Array to string conversion when trying to get a column from a stored procedure using Laravel 5.2 -


i've been struggling while now, thought post here , see if has solution why it's throwing array string conversion exception. here code:

model

public function getpackagereference(request $request) {     $package_reference = $request->input("package_reference");      $result = db::select("call getpackagereference(?)", array($package_reference));      return $package_reference .$result; } 

stored procedure:

delimiter // create procedure getpackagereference (in package_reference_param varchar(20)) begin     select lpad(cast((count(distinct package_reference) + 1) char(3)), 3, '0') package_reference     package  package_reference concat(package_reference_param, '%'); end // delimiter ; 

stored procedure result:

call getpackagereference('t2agb')

package reference

so in model return package_reference value.

cheers,

tim

the $result variable array , typing $package_reference .$result want convert string , that's causing exception. in php, arrays cannot converted strings.


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -