Answer the question
In order to leave comments, you need to log in
How to call PostreSQL function in PHP using PDO?
There is a function https://gist.github.com/kissarat/cb5df1c577c5e5da2d05
I call it using $pdo->exec('SELECT descend(4)'); or $pdo->query('SELECT descend(4)')->fetch(); and i get an error
PHP Warning: Uncaught exception 'PDOException' with message 'SQLSTATE[42601]: Syntax error: 7 ERROR: query has no destination for result data
HINT: If you want to discard the results of a SELECT, use PERFORM instead.
CONTEXT: PL/pgSQL function descend(integer) line 11 at SQL statement' in php shell code:1
Stack trace:
#0 php shell code(1): PDO->query('SELECT descend(...')
$parent_id = SQL::queryCell('SELECT descend(:root_id)', [
':root_id' => $this->id
]);
Answer the question
In order to leave comments, you need to log in
SELECT root_id, level, count(*) as count FROM matrix GROUP BY root_id, level
HAVING count(*) < power(_type.degree, level);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question