Help for this page
CREATE TABLE node ( id int(10) NOT NULL auto_increment, ... parent int(10) default '0', PRIMARY KEY (id) );
use strict; use warnings; ... sub get_last_id { return $dbh->selectcol_arrayref('SELECT last_insert_id()')->[0]; }