1 year ago

get data from database error.

Posted 1 year ago by oziel
$user_id = Auth()->user()->id;
        $user = User::find($user_id);
        return view('Dashboard')->with('posts',$user->posts);

i have the following errors

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'users.user_id' in 'where clause' (SQL: select * from users where users.user_id = 1 and users.user_id is not null)

Please sign in or create an account to participate in this conversation.