We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Translation database Adaptater function "exists"

Hi guys,

I use database translation and I had an error when use "exists" function from Phalcon\Translate\Adapter\Database.

public static function getTranslation()
        return new \Phalcon\Translate\Adapter\Database( [ 'db' => \Phalcon\DI\FactoryDefault::getDefault()->getShared('db'), 'table' => 'translations', 'language' => Utils::getLanguage() ]);

    $t = self::getTranslation()->exists('foo');

result :

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0' at line 1

I just remove "0" line 95 and it works.

It's a bug or I use it badly ?

It looks like an error, could you please submit it as a bug? https://github.com/phalcon/incubator/issues