在 Laravel 4 中使用存储过程 [英] Using a stored procedure in Laravel 4
本文介绍了在 Laravel 4 中使用存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试通过 laravel 路由调用存储过程,但我不断收到错误消息:
I'm trying to call a stored procedure from via a laravel route and i keep getting an error:
{"error":{"type":"Illuminate\Database\QueryException","message":"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'emailAddress' in 'field list' (SQL: CALL getLibraryList(emailAddress))",
我相信我打的电话是正确的:
I believe the call I'm making is correct:
$result = DB::statement('CALL getLibraryList('.$email.')');
return $result;
推荐答案
找到了实现此功能的方法 这里:
Found out a way to get this working here:
$result = DB::select('call getLibraryList(?)',array($email));
这篇关于在 Laravel 4 中使用存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文