mardi 28 février 2017

php if && || OR statement returning nothing ... but does separately

I'm truly puzzled and need someone to shed some light on this matter for me please.

When I use those 2 statements separately they get results:

$ads->where('country_to', '=', $_COOKIE['country_from'])

$ads->where('country_from', '=', $_COOKIE['country_from']);

... but once I tried to use the OR statement then I get no results, just wondering why?

        $ads->where('country_to', '=', $_COOKIE['country_from']) || $ads->where('country_from', '=', $_COOKIE['country_from']);

I also tried this way, no results either:

    $ads->where('country_to', '=', $_COOKIE['country_from'] || 'country_from', '=', $_COOKIE['country_from']);

Can someone tell me what I'm doing wrong here? Thanks all ;-)

Aucun commentaire:

Enregistrer un commentaire