0

I want to create a dynamic drop down list box in which

Locality is loaded on page load
then
Depending upon selected Locality...
Sub locality , Ward will be Loaded...
..
I done it by using form with 'get' method..
but
I want to done it using post method..
so that
Selected values are not shown in the URL..

Database Dump is Attached with it....

and

Demo can be seen here

http://www.plus2net.com/php_tutorial/dd.php

from which i taken Help...


Thanks...

Attachments
-- phpMyAdmin SQL Dump
-- version 3.3.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 10, 2011 at 06:36 AM
-- Server version: 5.1.53
-- PHP Version: 5.3.4

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `mcy_survey`
--

-- --------------------------------------------------------

--
-- Table structure for table `block`
--

CREATE TABLE IF NOT EXISTS `block` (
  `locID` smallint(2) NOT NULL DEFAULT '0',
  `bID` smallint(2) NOT NULL DEFAULT '0',
  `bName` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`locID`,`bID`),
  UNIQUE KEY `blockIndex` (`locID`,`bID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `block`
--

INSERT INTO `block` (`locID`, `bID`, `bName`) VALUES
(0, 0, 'SELECT BLOCK'),
(1, 0, 'SELECT BLOCK'),
(1, 1, 'A/7'),
(2, 0, 'SELECT BLOCK'),
(2, 1, 'B/7');

-- --------------------------------------------------------

--
-- Table structure for table `locality`
--

CREATE TABLE IF NOT EXISTS `locality` (
  `locID` smallint(2) NOT NULL,
  `locName` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`locID`),
  UNIQUE KEY `locID` (`locID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `locality`
--

INSERT INTO `locality` (`locID`, `locName`) VALUES
(0, 'SELECT LOCALITY'),
(1, 'YAMUNANAGAR'),
(2, 'JAGADHRI');

-- --------------------------------------------------------

--
-- Table structure for table `sub_locality`
--

CREATE TABLE IF NOT EXISTS `sub_locality` (
  `locID` smallint(2) NOT NULL DEFAULT '0',
  `subLocID` smallint(2) NOT NULL DEFAULT '0',
  `subLocName` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`locID`,`subLocID`),
  UNIQUE KEY `LocSubloc` (`locID`,`subLocID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `sub_locality`
--

INSERT INTO `sub_locality` (`locID`, `subLocID`, `subLocName`) VALUES
(0, 0, 'SELECT SUB LOCALITY'),
(1, 0, 'SELECT SUB LOCALITY'),
(1, 1, 'TAGORE GARDEN ( BUS STAND )'),
(1, 2, 'MODEL TOWN'),
(1, 3, 'SHASTRI COLONY'),
(2, 0, 'SELECT SUB LOCALITY'),
(2, 1, 'JAGADRHI_1'),
(2, 2, 'JAGADHRI_2');

-- --------------------------------------------------------

--
-- Table structure for table `ward`
--

CREATE TABLE IF NOT EXISTS `ward` (
  `locID` smallint(2) NOT NULL DEFAULT '0',
  `ward` smallint(2) NOT NULL DEFAULT '0',
  PRIMARY KEY (`locID`,`ward`),
  UNIQUE KEY `locIDIndes` (`locID`,`ward`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `ward`
--

INSERT INTO `ward` (`locID`, `ward`) VALUES
(0, 0),
(1, 1),
(1, 2),
(1, 3),
(1, 4),
(1, 5),
(1, 6),
(2, 1),
(2, 2),
(2, 3),
(2, 4),
(2, 5);

--
-- Constraints for dumped tables
--

--
-- Constraints for table `block`
--
ALTER TABLE `block`
  ADD CONSTRAINT `block_ibfk_1` FOREIGN KEY (`locID`) REFERENCES `locality` (`locID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `sub_locality`
--
ALTER TABLE `sub_locality`
  ADD CONSTRAINT `sub_locality_ibfk_1` FOREIGN KEY (`locID`) REFERENCES `locality` (`locID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `ward`
--
ALTER TABLE `ward`
  ADD CONSTRAINT `ward_ibfk_1` FOREIGN KEY (`locID`) REFERENCES `locality` (`locID`) ON DELETE CASCADE ON UPDATE CASCADE;
3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by decade
0

you are using database here therefore you need to select first the table_column of the database that has the value that you are going to use for the list.
it will give you an array result then
call it in a function so that everytime you add or remove a value on your database it will automatically updated.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.