Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Issue with multiple where on same column #58

Open
MoogyG opened this issue Dec 15, 2017 · 4 comments
Open

Issue with multiple where on same column #58

MoogyG opened this issue Dec 15, 2017 · 4 comments

Comments

@MoogyG
Copy link

MoogyG commented Dec 15, 2017

$searchText = 'test';
$query_builder = User::search($searchText);
$query_builder->where('a <=', 10);
$query_builder->where('b >=', 100);

it's correct, result :

select count(*) as aggregate from `beats` where a< '10' AND b> '100' 
AND MATCH(title) AGAINST('test' IN NATURAL LANGUAGE MODE)

but if i do

$searchText = 'test';
$query_builder = User::search($searchText);
$query_builder->where('a <=', 10);
$query_builder->where('a >=', 100);

result

"Illuminate\Database\QueryException

SQLSTATE[HY093]: Invalid parameter number (SQL: select count(*) as aggregate 
from `users` where a<= 100 AND a>= test AND MATCH(title) AGAINST(? IN NATURAL LANGUAGE MODE))
@msonowal
Copy link
Collaborator

msonowal commented Dec 15, 2017

@MoogyG Try this as

$searchText = 'test';
$query_builder = User::search($searchText);
$query_builder->where('a', '<=', 10);
$query_builder->where('a', '>=', 100);

@MoogyG
Copy link
Author

MoogyG commented Dec 15, 2017

Not working, result :

select count(*) as aggregate from `users` where a = '>=' AND MATCH(title) AGAINST('test' IN NATURAL LANGUAGE MODE)

@varuog
Copy link

varuog commented Oct 25, 2018

I am facing same issue. need some workaround for this

@Kaishiyoku
Copy link

Same issue here

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants