Drag-and-drop menu with MySQL

In this post i will explain to how to create a Drag and Drop Menus in your web application using php and mysql. This script allows you to manage your menu using drag and drop elements to create a page hierarchy on your webpage. We connect these events using Jquery & Ajax functionalities to update the menu structures.

I am using PDO ( PHP Data Objects) in this example. By using PDO you will take advantage of native prepared statement present in MySQL 4.1 and higher versions. If you’re using an older version of mysql client libraries, PDO will emulate them for you.

sortable_nested_menu

Download      Demo

Database connection file config.php
Create config.php file and copy bellow code snippets and paste.

index.php file

Create css file style.css
You can customize the styles according to your website theme by simply modifying bellow code snippets.

Create updatedata.php
Bellow code will update the database entries of listorder tables.

Download      Demo

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:


Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of FreeWebMentor.com (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.

Article Tags: , , ,