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

Split phalcon create builder not working

Hi everyone,

I discover that (i made a mistake) when i used createBuilder() on 1 query its working, but when i split it, it doesnt. But it gives phql true.

Working Code :

$competitors = $this->modelsManager->createBuilder()->from(array('cr' => 'Competitor'))
                ->columns(array(
                "cr.id as id",
                "cr.name as name",
                "cr.last_name as last_name",
                "cr.slug as slug",
                "cr.social_media as social_media",
                "cr.about as about",
                "cr.status as crstatus"))
                ->orderBy('cr.name ASC')
                 ->getQuery()
                 ->execute()

Not working code :

$competitors = $this->modelsManager->createBuilder()->from(array('cr' => 'Competitor'))
    ->columns(array(
    "cr.id as id",
    "cr.name as name",
    "cr.last_name as last_name",
    "cr.slug as slug",
    "cr.social_media as social_media",
    "cr.about as about",
    "cr.status as crstatus"));

    $comptetitors->orderBy('cr.name ASC')
     ->getQuery()
    ->execute()


950

you need to semicolon in the end...

or Did you forget in the ask?