Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9126333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:01:03+00:00 2026-06-17T07:01:03+00:00

I need a database that contains a set of pages: their ID, parent ID

  • 0

I need a database that contains a set of pages: their ID, parent ID (0 if no parents) and order.

+------+------------+-----------+-------------+
|  ID  |  parentID  |   order   |    Name     |
+------+------------+-----------+-------------+
|  1   |      0     |     1     |    page 1   |
|  2   |      1     |     1     |    page 2   |
|  3   |      1     |     2     |    page 3   |
|  4   |      0     |     2     |    page 4   |
|  5   |      0     |     3     |    page 5   |
+------+------------+-----------+-------------+

Then I have a sortable nested ul li that works with jQuery such as this

<ul id="sortablenested">
  <li>page 1
  <ul>
     <li>page 2</li>
     <li>page 3</li>
  </ul>
  </li>
  <li>page 4
  <ul></ul>
  </li>
  <li>page 5
  <ul></ul>
  </li>
</ul>

Now if it wasn’t nested, I would just use an hidden input within each li tag passing an array and then go through the array with a foreach and write the position in the DB but when I move a li from the root ul to a sub ul with the same method it wouldn’t nest it but just go through the array ignoring that it’s a child.

What is the best/right method to submit the order to the database?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:01:04+00:00Added an answer on June 17, 2026 at 7:01 am

    I would either send whole HTML of the list tree (innerHtml) if it’s this simple, or write JavaScript function to convert it to JSON, and send that. And parse that on server.

    See How to serialize DOM node to JSON even if there are circular references?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a query result set that contains data that I need to filter,
I have a number of reports that I run against my database that need
Just need some quick clarification I have 2 Queries in my Access Database that
I have some data in a database that I need represented in an XML
I have a SQL Server 2005 database that has been deleted, and I need
I have a MySQL database, and a particular table in that database will need
I have a table in an Oracle database that contains actions performed by users
Right now we have a dll file that contains all the database calls and
I need to set up a database that will contain submissions from forms in
I have a database that contains data in different languages. Some languages use accents

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.