SitePoint Sponsor

User Tag List

Results 1 to 24 of 24

Threaded View

  1. #1
    Non-Member Kalon's Avatar
    Join Date
    Aug 2010
    Location
    At my computer
    Posts
    2,012
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Move Nested Set Node

    Hi,

    I am using the Nested Set Model to manage categories for an online store.

    I have got sql queries to display/add/delete category nodes and their children and they work fine.

    What I need now is some help to write the sql to move a node and its children to a new parent node.

    I am trying to avoid deleting the node and then inserting it under the new parent because that would involve storing the node temporarily somewhere first.

    Can anybody please point me in the right direction with any links to where this has already been done.

    In this case, google hasn't been too friendly or maybe I'm not using the right keywords.

    If it's any help, this is my category table structure.

    Code:
     
    Field
    ------
    fldCatId
    fldCatName
    fldLft
    fldRgt

    Any help will be much appreciated.
    Last edited by Kalon; Sep 11, 2010 at 15:25. Reason: typos


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •