We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

getLastQuery

How do I print will finally resolve the SQL execution?

There is good sample on SO:

$queryBuilder = new Builder();
$queryBuilder->from(…)->where(…);

$intermediate = $queryBuilder->getQuery()->parse();
$dialect      = DI::getDefault()->get('db')->getDialect();
$sql          = $dialect->select($intermediate);


20.5k

If I am using this: if (!empty($search) && $search != '') {

    $query = Criteria::fromInput($this->di, 'jiazu', $search);
    $jiazus = Jiazu::find($query->getParams());
} else {

    $jiazus = Jiazu::find();
}

How do I get