Hi,
i get different results when i use the create builder or the phpmyadmin SQL Editor. So when i am logged in as user ID 48, i get only the result set of user with ID 48 with create builder, what is wrong for me!
$users = $this->modelsManager->createBuilder()
->from('Vokuro\Models\Users')
->join('Vokuro\Models\Searchcriteria ON Vokuro\Models\Searchcriteria.country = Vokuro\Models\Users.country AND Vokuro\Models\Users.region LIKE CONCAT(SUBSTRING(Vokuro\Models\Searchcriteria.zipcode, 1, 1),"%")')
->where('Vokuro\Models\Searchcriteria.usersId = :id:',array('id' => $id))
->orderBy('Vokuro\Models\Users.region')
->getQuery()
->execute();
But when i use raw SQL in phpmyadmin SQL Editor:
select * from Users
join Searchcriteria ON Searchcriteria.country = Users.country AND Users.region LIKE CONCAT(SUBSTRING(Searchcriteria.zipcode, 1, 1),"%")
where Searchcriteria.usersId = 48
order By Users.region
I get the result set of user with ID 68, 69, what is totally correct for me!
Where is the difference? What i am doing wrong?
Thx for help