pass parameters in insert query stored procedure in laravel 4

前端 未结 1 1557
予麋鹿
予麋鹿 2021-01-16 18:38

I have created a procedure for insertion but dont know how to call parameters \"name\" and \"path\" in controller and model

Stored procedure:

CREATE          


        
相关标签:
1条回答
  • 2021-01-16 19:07

    The second takes a list of parameters that can be passed as below

    DB::select('call insert_document_details(?,?)',array($name,$path));
    

    or

    DB::statement('call insert_document_details(' . DB::raw($name) . ',' . DB::raw($path) . ')');
    
    0 讨论(0)
提交回复
热议问题