it would help if we could see the whole query
Sep 2, 2017
8
Level 3
Query always returns a value
I am running this query:
['id', '=', $value],
['attribute_question_id', '=', $question->id]])->select(['id', 'attribute_question_id'])->firstOrFail();
and it always returns a value when it should not. If I have $value = 0 I know there is no record in the database with id = 0 so it should fail, but it simply moves along and pulls the record where 'attribute_question_id', '=', $question->id
This is more of a validation use query so I am checking that yes there is a record in the database where id = $value AND attribute_question_id = $question->id
Not an either or like it appears to be doing.
Thoughts, suggestions?
Thanks, Dave
Please or to participate in this conversation.