Ejemplo n.º 1
0
function find_root_article($article_id)
{
    $result = fetch_first_row("SELECT * FROM exchange_article WHERE ID = ?", 'i', $article_id);
    if ($result['parent_id'] == NULL) {
        return $result;
    } else {
        return find_root_article($result['parent_id']);
    }
}
Ejemplo n.º 2
0
function find_root_article($id)
{
    $row = fetch_first_row("SELECT * FROM exchange_article WHERE ID = ?", "i", $id);
    var_dump($row['parent_id']);
    if ($row['parent_id'] == NULL) {
        return $id;
    } else {
        return find_root_article($row['parent_id']);
    }
}