+ Reply to Thread
Results 1 to 2 of 2

Thread: Change Sort order of db records

  1. #1
    nandana is offline Member
    Join Date
    Jan 2009
    Posts
    61

    Smile Change Sort order of db records

    Hi all,
    I have complex problem(I think!!). It is like this...
    My database table name: Subjects
    Columns: Id int
    subject varchar(30)
    sortorder int
    parent_id

    So there will be many subjects which are primary parents and many children and grand children as well.

    Now I need to
    1) change the sort order of the existing subjects while editing the records
    2) insert a new record with existing sort order

    In eother of the above cases sort order of rest of the subjects should change accordingly, Can some one help me with coding this requirement please.

    Thank u

  2. #2
    armandop is offline Member
    Join Date
    Nov 2008
    Location
    San Jose
    Posts
    35

    Default

    This doesnt seem like a ZF issue but more of your application requirement. Humm
    So just to have it make sense in my head. Is this what you want done?

    1. Record can be updated with a NEW sort order.
    A. If the sort order is updated, all the other records will update accordingly.
    2. Add a new record
    A. When adding a new record a sort order is provided for the record by the system and NOT by the user?

    For the updating, if you want it "as you edit" youll need Ajax and an OnChange call the Oncahnge call will be on the form field that contains the 'sortorder field"

    The real problem your going to encoutner and im not sure if your this far in the code, is the fact that as your database grows so does the time it takes to update these records on the fly thats IF my assumptions are correct. Depending on how you resort the sort orders this might be an issue.

    Armando Padilla
    www.armando.ws
    Author: Beginning Zend Framework

+ Reply to Thread

Similar Threads

  1. deleting multiple records help
    By derrida in forum General Q&A on Zend Framework
    Replies: 2
    Last Post: 11-05-2009, 09:49 AM
  2. Replies: 0
    Last Post: 04-24-2009, 11:19 AM
  3. Lucene hangs with 7k records
    By Juzwa in forum Mail, Formats & Search
    Replies: 0
    Last Post: 04-11-2009, 10:19 AM
  4. best way to delete multiple records from table?
    By TheZend in forum Databases
    Replies: 2
    Last Post: 08-18-2008, 03:06 AM
  5. sort rowset
    By Lagaffe in forum Databases
    Replies: 0
    Last Post: 05-03-2008, 09:13 AM

Posting Permissions

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