我與兩種類型 1)如何調用在laravel PostgreSQL的存儲過程5
DB::statement('call abc_cmw("$ipaddress","$cname","$recvd_date","$language","$address1","$address2","$address3","$pincode","$mobileno","$amobileno","$email_address","$idproofdetail","$Description","$remedies","$gretype","$fcount","$content1","$content2","$district_problem","$city_problem", "$block_problem","$village_problem","$username","$sugg_demand","$dept_name","$indiv_grp","$ac_problem")');
2)
DB::select('exec abc_cmw("$ipaddress","$cname","$recvd_date","$language","$address1","$address2","$address3","$pincode","$mobileno","$amobileno","$email_address","$idproofdetail","$Description","$remedies","$gretype","$fcount","$content1","$content2","$district_problem","$city_problem", "$block_problem","$village_problem","$username","$sugg_demand","$dept_name","$indiv_grp","$ac_problem")');
但兩種方式具有相同的錯誤
QueryException in Connection.php line 647: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "call" LINE 1: call abc_cmw("$ipaddress","$cname","$re...^(SQL: call abc_cmw("$ipaddress","$cname","$recvd_date","$language","$address1","$address2","$address3","$pincode","$mobileno","$amobileno","$email_address","$idproofdetail","$Description","$remedies","$gretype","$fcount","$content1","$content2","$district_problem","$city_problem", "$block_problem","$village_problem","$username","$sugg_demand","$dept_name","$indiv_grp","$ac_problem"))
我想在您的解決方案問號知道有列名替換或者我需要instert問號每列? –
您可以使用命名的綁定(第二個示例)或數組綁定(第一個示例)。如果您更喜歡數組綁定,請爲每列添加問號。 – AlexM
好吧讓我試試第一個例子 –