SQLSTATE[42S22]: Column not found: 1054 Unknown column 'id' in 'where clause' (SQL: select * from `songs` where `id` = 5 limit 1)

前端 未结 5 1859

I am trying to get specific data from the database by using column SongID when a user clicks a link but I am getting this error:

SQLSTATE[42

5条回答
  •  滥情空心
    2021-02-02 08:14

    protected $primaryKey = 'SongID';

    After adding to my model to tell the primary key because it was taking id(SongID) by default

提交回复
热议问题