1
我有一个文本输入,用户必须输入电影的名字,我也有一个电影数据库,当用户输入电影的标题,电影的标题将与电影数据库上的标题相匹配,然后应该在电影表中获取电影的movie_id并将其保存在电视节目表中。从laravel 5.4的同一行得到一个不同ID的值。
$movtitle = $request->Cinename;
$mov_tit = Schedule::where('movtitle', '=', $movie->title);
$mov_id = find($movie->movie_id where $title = $mov_tit);
//this is wrong. what is the correct syntax??
如何阅读Laravel的基本文档? –
同意@RoboRobok 看起来你使用的是Eloquent:https://laravel.com/docs/5.4/eloquent –