php basic


Dynamic dependent dropdown select list using jquery and php

In this tutorial we are going to see how to change states drop down list ans city drop down list option based on the dropdown select country name. we are going use jquery and mysql database for select country and retrieve state data. means Loading records from database dynamically and display it in select box without refreshing the whole page with the help of Ajax and jQuery and PHP code.  country state city Dropdown, using ajax and jqurey fill country state city dropdown.  Ajax country state city dropdown php, onchange in jquery, dynamic dropdown.

Step 1:  Create database and database table With content. Create database name “Country_db” and table with Country, state and city

Country table:

Cities Table

States Table

Step 2: Database Config

Step 2: Create the index page

Step 3: create jquery with ajax function to pass country id into next page and select state and cities form the database table

Ajax page for select database of cities and states

That’s it enjoy the code. demo and download the script and use it easily. Feel free to comment your suggestions regarding this tutorial. Subscribe me. 

PHP Introduction

Before learning php, you should have some knowledge in below topics:

  • HTML
  • CSS
  • JavaScript

Define php?

  • PHP is an acronym for “Hypertext Preprocessor”
  • PHP is a widely-used, open source scripting language
  • PHP scripts are executed on the server
  • PHP costs nothing, it is free to download and use

Php File

  • PHP files can contain text, HTML, CSS, JavaScript, and PHP code
  • PHP code are executed on the server, and the result is returned to the browser as plain HTML
  • PHP files have extension “.php”

Thats basic intro about PHP