I'm in the process of developing the backend of an application and I use laravel in recover I want to select securite question of this user
$User_data = User::where('email', '=', $email)->leftJoin('secutitequestion', function($join) {
$join->on('users.id', '=', 'secutitequestion.user_id')->pluck('secutitequestion.securite_question1'
,'secutitequestion.answer_securite_question1'
,'secutitequestion.securite_question2'
,'secutitequestion.answer_securite_question2'
,'secutitequestion.securite_question3'
,'secutitequestion.answer_securite_question3');
});
and I this what I get :
"SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on
users
.id
=secutitequestion
.user_id
' at line 1 (SQL: selectsecutitequestion
.securite_question1
,secutitequestion
.answer_securite_question1
onusers
.id
=secutitequestion
.user_id
)"
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire