Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
sql query in FuelPHP?
  • hi,
    I want to do the following query in fuelphp but don't find in the doc the way to do the last part of my query.
    my sql query is:
    SELECT *
    FROM `sgsses`
    WHERE `categorie` = 'manuel'
    AND (
    `langue` = 'fr'
    OR `langue` = 'it'
    )
    my fuelphp query is : $data = Model_Sgss::find('all', array('where' => array(array('categorie', '=', 'manuel'), array('langue', '=', 'fr'))));
    I don' find the way to do '`langue` = 'fr' OR `langue` = 'it', can someone help me.
    thank you
  • I don't know if and how you could do that when using array notation. When using chaining, you would use
    $data['sgsss'] = Model_Sgss::query()
        ->where('categorie', '=', 'manuel')
        ->where_open()
            ->where('langue', '=', 'fr')
            ->or_where('langue', '=', 'it')
        ->where_close()
        ->get();
    

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion