Can you share your database table structure? It seems that propID doesn't exist
Mar 28, 2019
7
Level 1
Column not found: 1054 Unknown column 'bookings.propID ' in 'on clause' (SQL: select * from `users` inner join `bookings` on `bookings`.`user_id` = `users`.`id` inner join `properties` on `properties`.`id` = `bookings`.`propID ` where `properties`.`user_i
Complete Error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'bookings.propID ' in 'on clause' (SQL: select * from users inner join bookings on bookings.user_id = users.id inner join properties on properties.id = bookings.propID where properties.user_id = 4)
public function getuserbooked() {
$otherBooked = DB::table('users')
->join('bookings', 'bookings.user_id', '=', 'users.id')
->join('properties', 'properties.id', '=', 'bookings.propID ')
->where('properties.user_id',Auth::User()->id)
->get();
return view('propView.otherBooked')->with('otherBooked',$otherBooked);
}
I can not find the mistake please help me. all the column names are correct
Level 4
Try this too
$otherBooked = DB::table('users')
->join('bookings', 'bookings.user_id', '=', 'users.id')
->join('properties', 'properties.id', '=', 'bookings.propID') //u have added space here remove check it once
->where('properties.user_id',Auth::User()->id)
->get();
$id = Auth::User()->id;
$otherBooked = DB::table('users')
->join('bookings', 'bookings.user_id', '=', 'users.id')
->join('properties', 'properties.id', '=', 'bookings.propID')
->where('properties.user_id',$id)
->get();
Please or to participate in this conversation.