mardi 4 octobre 2016

Check if a value is present in a comma separated varchar string

I have a record "id_zone" in database that store cites id like this $abilitato->id_zone = '1, 2, 3, 9, 50' From laravel i need to check if a value passed from url is present in this field. The following work only if i have a single value

$abilitato = \App\Models\Servizi::where('id', $servizio)->('id_zone', $verifica->id_citta)->first();
                if(!empty($abilitato) && empty($verifica->multicap)) {
                $json = ['CAP' => '1' , 'DEB' => $cap ];
                    }else{
                $json = ['CAP' => '0' , 'DEB' => $cap];

            }

i need to check if



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire