Search code examples
mysqlsymfony1propelmatch-against

Is there any way of using match against statement in Propel (ORM)?


Is there any way of using match against statement in Propel (ORM)? It is odd I cannot find anything related to this.


Solution

  • No direct support. Perhaps a custom query?

    $con = Propel::getConnection(BookPeer::DATABASE_NAME);
    $sql = "SELECT title,category FROM articles WHERE MATCH(title,category) AGAINST (:text); 
    $stmt = $con->prepare($sql);
    $stmt->execute(array(':text' => 'My match text'));