Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Export the data?

Quote Reply
Export the data?
Hello Alex!

I need your advice as to how to export the data with category name instead of IDs. The following is what I am trying to insert in the sub_routine of export_data in DBSQL.pm!

while ($arr = $sth->fetchrow_arrayref) {
##################################################
if ($arr{'CategoryID'}) {
$arr{'CategoryID'} = &get_category_name ($arr{'CategoryID'});
}
###################################################
foreach (@$arr) {

May be there is something missing. Can you help?

Thanks in advance.
Quote Reply
Re: Export the data? In reply to
Hello!

Also I would like to delete at the same time like the following:

I have defined the my (...)


foreach $id (@db) {
$result = &Links: BSQL::delete_record ( $id );
$result or ($error{$id} = "<li>$id (Record exported, but couldn't remove from validation table.)") and next;
}


Thanks
Quote Reply
Re: Export the data? In reply to
Yes, $arr is an arrayref, not a hashref. You'd need to do something like:

$arr->[5] = &get_category_name($arr->[5]);

where 5 is the proper position of CategoryID.

Cheers,

Alex