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

Phalcon db adapter not working with mysql-proxy

Plain and simple I am getting this message:

PDOException: SQLSTATE[HY000]: General error: 1243 Unknown prepared statement handler (1) given to mysqld_stmt_execute
/var/www/project/app/controllers/IndexController.php (65)

when using mysql-proxy with phalcon.

Funny this that if I use plain php to connect to mysql-proxy that is working (I am using mysql-proxy for many projects and it is working on all of them).

This is query:

$users = User::query()
        ->where("parse_id != ''")
        ->order("ID")
        ->execute();

Any idea why this is not working and how to debug this? If you need more info please tell me what else of debug info do you need?



7.8k

This is not helping. I do not know what is the probelm in first place. Can you explain what phalcon is trying to do? Is this reposne from mysql server or?

Maybe this could help: https://stackoverflow.com/questions/16074952/mysql-1243-unknown-prepared-statement-handler-stmt-given-to-execute



7.8k
Accepted
answer

After some diggining I came to this conslusion.

This has nothing to do with Phalcon. mysql-proxy read/write script does not support mysql prepeard statments. So that is rw-splitting.lua problem and not Phalcon.



635

Hello , as a beginner , php uses larvarl framework I have encountered the same problem , the solution for several hours , and still not been resolved , ask for help , the rw-splitting.lua how to rewrite the script it?

After some diggining I came to this conslusion.

This has nothing to do with Phalcon. mysql-proxy read/write script does not support mysql prepeard statments. So that is rw-splitting.lua problem and not Phalcon.



635

PDOException in MySqlConnector.php line 56: SQLSTATE[HY000]: General error: 1243 Unknown prepared statement handler (2) given to mysqld_stmt_execute