lundi 18 janvier 2016

How to get data from '-'(hyphen) separated value in mysql [Laravel 5.1]?

i want to get data from '-'(hyphen) separated values in mysql database in Laravel 5.1,

for example:

Table price:

id  price  
1   100-200  
2   300-500  
3   500-700  
4   800-900
5   500  
6   1000-1500

now i want to get data greater than or equal to 400,

here is the code what i have tried so far:

$query->where('price.'.price, '>=', 400)

but it returns all the data, but i want to get only relevant data.

Please help me to sort out this issue.

Thanks.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire