Skip to content

Instantly share code, notes, and snippets.

View jojobyte's full-sized avatar

jojobyte

View GitHub Profile

_queryTreeSort

Note: Please check this blog post for more details on these functions.

Sort a SQL query with id and parentid so that the rows have the correct order of the tree.

Parameters:

  • q (Array): A query result (see example below)