Hmm, seems my first Message didn't save...
You can use something like: $c->setIgnoreCase(true); in combination with LIKE or if you only use mysql you can use: $c->add(TablePeer::FIRSTNAME, 'SUBSTR('.TablePeer::FIRSTNAME.')='. $first_initial, Criteria::CUSTOM); I think this is waht you want. Marius On Oct 26, 6:15 pm, Ari Army <armyofda12mnk...@gmail.com> wrote: > Hey all, > I was wondering if this can be done via Propel's Peer classes... > > WHERE > NO1='302-3001' > AND > NO2=2892 > AND -- the PART below is where i stumble > LOWER( SUBSTR(FIRSTNAME,1,1) )='b' > AND > LOWER( SUBSTR(LASTNAME,1,1) )='r' > > tried something like this before realized even though $first_initial is > lowercase, if the field value is not, then i cant search for it: > $c = new Criteria(); > $crit0 = $c->getNewCriterion(TablenamePeer::FIRSTNAME, $first_initial); > //??? > $crit1 = $c->getNewCriterion(TablenamePeer::LASTNAME, $last_initial); //??? > $crit0->addAnd($crit1); > $c->add($crit0); > $c->add(TablenamePeer::NO1, $no1); > $c->add(TablenamePeer::NO2, $no2); > > also tried to think if was way to do it via LIKE but still need lower > case... > aka LOWER(FIRST_NAME) LIKE 'b%' > $crit0 = $c->getNewCriterion(TablenamePeer::FIRSTNAME, $first_initial.'%', > Criteria::LIKE); //??? still needs LOWER somehow to be put in there. > > I guess maybe a custom query not using the Peer classes is teh only way can > be done since db functions are database specific? (unless maybe Propel > abstracts the common functions) > > Thanks in advance!, > Ari --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---