Support the ongoing development of →
posted 8 years ago
Last updated 5 months ago.

Your problem is here:

$days1 = implode(',', Input::get('days'));

This gets converted to string "8.4"

Then when you run

$query->whereIn('days', array($days1))->orderBy('days', 'asc');

array($days1) converts "8.4" to

    [0] => 8,4

8,4 then gets converted to an int to match the column in your db. (int)8,4 = 8

Hence only rows with 8.

So either don't implode at the start, or explode(",", $days1) instead of array($days1);

Makes sense?

Last updated 5 months ago.

Already solved this ...

As the same way, as You proposed.

Thanks !

Last updated 5 months ago.

Sign in to participate in this thread!


Your banner here too?

goranata goranata Joined 12 Mar 2014


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 - All rights reserved.