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

use Zephir && mysql select data return false AND type problem return Segmentation fault

    var result;
    var b;
    let result = "SELECT * FROM `". table ."` ORDER BY `id` DESC";
    let b = mysql_query(result);
    var_dump(b); //show false not data

    AND

    var result;
    boolean b;
    let result = "SELECT * FROM `". table ."` ORDER BY `id` DESC";
    let b = (boolean) mysql_query(result);
    var_dump(b); //show Segmentation fault

    ALL::

    namespace Mybetdata\Db;
    class Db
    {
        const HOST = "localhost";
        const ROOT = "root";
        const PASS = "b64a17a27f";
        const DATA = "test";
        const SET = "utf8";
        public link;
        public table;
        public function __construct()
        {
            var e;
            try {
                let this->link = mysql_connect(self::HOST, self::ROOT, self::PASS);
                mysql_set_charset(self::SET);
                mysql_select_db(self::DATA, this->link);
            } catch \Exception, e {
                echo e->getMessage();
                echo "\n";
                echo mysql_errno();
                echo mysql_error();
            }
        }
        public function _getall(const string table = "", where)
        {
            var result;
            var b;
            let result = "SELECT * FROM `". table ."` ORDER BY `id` DESC";
            let b = mysql_query(result);
            var_dump(b); //show false not data
        }
    }
    var Db;         
    let Db = new \Mybetdata\Db\Db();
    Db->_getall("size", null);


98.9k

Could you please post this in the Zephir forum? https://forum.zephir-lang.com/