【发布时间】:2015-04-12 07:35:52
【问题描述】:
我想使用 Eloquent 更新我的数据,但它给了我一些错误:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'od_logo.id' in 'where clause' (SQL: select * from `od_logo` where `od_logo`.`id` = 1 limit 1)
这是我的代码:
$logo = Logo::find($id);
$logo->logo_logoimg_name = Input::get('logo_name');
$logo->logo_logoimg_path = $logo_destinationPath . $logo_filename;
$logo->logo_faviconimg_name = $favicon_destinationPath . $favicon_filename;
$logo->save();
请找出我在这段代码中做错的地方
【问题讨论】:
-
你的主键列是叫
id还是别的什么? -
我的主键叫 logo_id
标签: php laravel laravel-4 orm eloquent