Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

fetchColumn is unknown by Phalcon version 1.3.3

The version of Phalcon I am using is 1.3.3

I want to get the number of rows of a table :

function paginationCount($tab){
    $config = array(
                    "host" => "localhost",
                    "dbname" => BDD,
                    "port" => 3306,
                    "username" => "root",
                    "password" => ""
                    );

    $connection = new \Phalcon\Db\Adapter\Pdo\Mysql($config);
    $nb = $connection->fetchColumn("SELECT COUNT(*) FROM ".$tab);
    $connection->close();
    return $nb;
}

At runtime I get an error saying that fetchColumn is unknown ! So how to fix it ?

That method is not implemented in that version of Phalcon



2.8k
edited Sep '15

For which version of Phalcon is it ? My PHP version is 5.4.16 , I use WAMP also ; which version of WAMP should I use also ?