Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Script to add forums

Quote Reply
Script to add forums
I want to add a forum through a script. The code I have is
Code:
my $fdb = new GT::SQL '/../admin/defs';
my $f_forum_db = $fdb->table('Forum');

# Add forum in Forum table
$f_forum_db->add ({
forum_id => $forum_id,
cat_id_fk => $cat_id_fk,
forum_name => $forum_name,
forum_desc => $forum_desc,
forum_total => 0,
forum_total_threads => 0,
forum_last => 0,
forum_last_poster => '',
forum_last_id => 0,
forum_sort_rank => 0,
forum_style => 1,
forum_allow_attachments => 1,
forum_allow_guest_attachments => 1,
forum_attachments => 0,
forum_allow_user_edit => 3,
forum_edit_timout => 0,
forum_hard_delete => 2
});
When I execute it, it adds a forum, but gives me the error: Can't call method "table" on an undefined value at /.../Forum.pm line 213.

Does anyone know what I have to change/add in order to prevent this error?

BTW, it works fine if I use the "insert" method instead of the "add" method.

Thanks a lot.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Subject Author Views Date
Thread Script to add forums yogi 2483 Feb 12, 2002, 7:54 AM
Post Re: [yogi] Script to add forums
Paul 2352 Feb 12, 2002, 8:06 AM
Thread Re: [yogi] Script to add forums
Alex 2357 Feb 12, 2002, 12:51 PM
Post Re: [Alex] Script to add forums
Paul 2328 Feb 12, 2002, 12:56 PM
Post Re: [Alex] Script to add forums
yogi 2330 Feb 12, 2002, 1:01 PM