Dynamic Dropdown list using AngularJS with PHP
Below code explains how to dynamically load a dropdown using angular js.and while selecting a particular employee name from the dropdown it will display the details of the employee. Step1: create database in mysql with name mytest_data. create a table tbl_employee
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
CREATE TABLE IF NOT EXISTS `tbl_employee` ( `id` int(10) NOT NULL, `name` varchar(200) NOT NULL, `age` int(10) NOT NULL, `email` varchar(100) NOT NULL, `phone` int(10) NOT NULL, `country` varchar(200) NOT NULL, `state` varchar(200) NOT NULL, `city` varchar(200) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; INSERT INTO `tbl_employee` (`id`, `name`, `age`, `email`, `phone`, `country`, `state`, `city`) VALUES (1, 'vasanthan', 34, 'vasanthanpv@gmail.com', 2147483647, 'india', 'Karnataka', 'mangalore'), (2, 'robin', 30, 'contact@mydoubts.in', 2147483647, 'india', 'mumbai', 'mumbai'); |
step2: create a php file called loaddata.php to fetch the employee details from… Read More »