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

Re: Command to alter multiple link & category paths?

Quote Reply
Re: Command to alter multiple link & category paths? In reply to
I give you a piece of code I use for something quite similar.. (move an entire subtree from a location to another)

hope that helps...

Code:
my @subs = split("\/", $move_subcat_from);
my $name = pop @subs;
$move_subcat_to ? ($move_subcat_to .= "/$name") : ($move_subcat_to = "$name");
$query = qq! UPDATE Category
SET Name = REPLACE(Name,'$move_subcat_from','$move_subcat_to')
WHERE Name LIKE '$move_subcat_from/%' or
Name = '$move_subcat_from'
!;
$result = $db->do ($query);

ciao


lepo


Lepo - lepo@lepo.org
Subject Author Views Date
Thread Post deleted by ryel01 ryel01 3699 Nov 14, 2000, 2:04 AM
Thread Re: Command to alter multiple link & category paths?
qango 3604 Nov 14, 2000, 4:55 AM
Thread Re: Command to alter multiple link & category paths?
Bearwithme 3617 Nov 14, 2000, 6:15 AM
Thread Re: Command to alter multiple link & category paths?
ryel01 3581 Nov 14, 2000, 1:11 PM
Post Re: Command to alter multiple link & category paths?
Lepo75 3570 Nov 14, 2000, 3:55 PM