Eleo Nona

Eleo Nona

1574232259

Getting started with Directus 7 and Docker (PHP & MySQL & Nginx)

I recently wanted to try out the very promising Directus 7, a PHP based Headless CMS (Content Management System, headless meaning it creates an API to work with single page apps), without a doubt explained better on the Documentation.

To get started, I went to visit the very well written documentation, which tells that the best way to start is to git clone [https://github.com/directus/directus.git](https://github.com/directus/directus.git) and configure a local Apache Web Server and MySQL database to try it.

Not wanting to install it locally (because… well, who does that anymore? Local environments are the less reproducible things of all, everyone does not have the same OS, OS version, packages installed, etc.), I turned to my best development friend: Docker!

I found that there is an official Docker repository for directus (Yay!), but sadly couldn’t make it work properly, was out of date and just wasn’t easy to use.

I finally decided to write this article to help dear developper friends in this inquiry.

Our goal :

  • Setup a docker PHP container being able to run the latest Directus version
  • Setup a docker container hosting a MySQL DB to use with Directus
  • Making them work together and letting us try it

Requirements to achieve that goal :

TL;DR : You can find the result of this article here , get it and run the Start stuff instructions to try out Directus 7 in Docker 🙂

Setup a docker PHP container being able to run the latest Directus version

I have to say my favorite stack does not include Apache, I way prefer Nginx working with PHP-FPM, so that is what this example with showcase.

First, let’s create a folder for our experiment: mkdir directus-test/

Inside that folder ( cd directus-test/ ), let’s create a Dockerfile and start from an image that’s gonna help us out:

FROM wyveo/nginx-php-fpm:latest

Then, let’s install a very simple NGINX config allowing us to serve the directus code:

COPY default_nginx_conf /etc/nginx/conf.d/default.conf

The default_nginx_conf is the following:

server {
  listen 80;  root /app/public/;
  index index.php index.html index.htm;
  server_name _; 
  location / {
    try_files $uri $uri/ /index.php;
  }
  
  # pass the PHP scripts to FastCGI server 
  location ~ \.php$ {
    try_files $uri =404;
    fastcgi_pass unix:/run/php/php7.3-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
  }
}

Hence, a very simple NGINX configuration looking for an index.php in the /app/public folder of our container, and forwarding any request to a *.php file to PHP-FPM through a socket ( /run/php/php7.3-fpm.sock ) which is already set up in the container.

We’re just missing the directus code!

Let’s get it from github, as it is advised in the documentation :

git clone https://github.com/directus/directus.git

Let’s build our container!

docker build -t directus_img .

Setup a docker container hosting a MySQL DB to use with Directus

You know what? I feel lazy and would prefer to spend my time trying the damn thing, so let’s just get an image from Docker hub!

For example, the default MySQL image looks nice ! https://hub.docker.com/_/mysql

Making them work together and letting us try it

Let’s run both containers and make sure they can interact with each other thanks to a Docker Network:

docker network create directus_test_network

Then let’s run our PHP container and give it access to the directus code :

docker run -dit --name directus_php --network directus_test_network -p 8000:80 -v "$(pwd)/directus/":/app/ --rm directus_img

In case you are not familiar with docker, the options allow us to:

  • directus_img is the image we built just before, including all we need
  • -d detach the process from the command line, i.e. your bash is not “stuck” in the process
  • -i keeps the shell interactive even if detached, which means you can still interact with the container
  • -t allocates a pseudo-TTY
  • --name names the container so we can find it easily with docker ps later, or to interact with it
  • --network specifies that container should be available in the network created just before
  • -p allows us to bind ports from the container (80 : the default web port) to a port of the host (your machine), here the 8000 , making it possible for you to go to localhost:8000 and see what the container serves on its port 80
  • -v mounting a volume (here: $(pwd)/directus/ , $(pwd) being the current folder) as a folder in the container ( /app/ )
  • --rm Automatically removes the container when it exits

The fact that directus_img is a the very end of the command is NOT because it is linked to --rm , but simply because it is necessary to pass all the options to docker run before specifying which image to run.

Then, let’s run our MySQL container:

docker run -d --name directus_mysql --network directus_test_network -p 3306:3306 -e MYSQL_DATABASE=directus -e MYSQL_ROOT_PASSWORD=root -v data:"$(pwd)/data" --rm mysql:5.7

The only new thing here is the -e option, allowing you to pass an environment variable to the container.

You can see here that we also bind the port 3306 on the host… Why? This allows you to connect you favorite SQL Manager tool (ex: Sequel Pro) to the DB on localhost:3306 and browse your data if need be.

We can see that our containers are running thanks to docker ps , which should give you something like the following:

This is image title

Result of docker ps

You can now go to http://localhost:8000/admin and setup directus :

This is image title

Ready to install!

The first step is to choose your login and password:

Fill the settings for the admin login

Then to specify the database credentials and settings:

This is image title

Fill the database settings

The only parameters to change here are:

  • the host , which is going to be directus_mysql
  • the user and password : root and root

Which is where we see the influence of having the two containers in the same network. Indeed, having them in the same network makes them “aware” of each other, giving access in the MySQL container to the PHP container on the “host name” directus_php and giving the PHP container access to the MySQL one on directus_mysql .

The docker network with default driver actually includes a DNS resolver so the nslookup done to resolve the IP from the hostnames (e.g. directus_mysql) finds the other container within the same subnet based on the same container name.

Submit the login form with the credentials set and BOOM! You’re in!

This is image title

Boom, you’re in!

You can now access the Admin Settings at the bottom left of the screen and get started creating your collections, etc. 🚀

This is image title

Admin settings at the bottom left of the screen

I have to say that after that, Directus gives a great feeling, everything is pretty smooth with a few hiccups, like some buttons not working, but you get it, it’s still a Work in Progress :)

You can find “all of this code” plus a few helpers here if you don’t want to waste your time trying all of that out.

Thank you for reading !

#Docker #Directus #PHP #MySQL #Development

What is GEEK

Buddha Community

Getting started with Directus 7 and Docker (PHP & MySQL & Nginx)
Shubham Ankit

Shubham Ankit

1657081614

How to Automate Excel with Python | Python Excel Tutorial (OpenPyXL)

How to Automate Excel with Python

In this article, We will show how we can use python to automate Excel . A useful Python library is Openpyxl which we will learn to do Excel Automation

What is OPENPYXL

Openpyxl is a Python library that is used to read from an Excel file or write to an Excel file. Data scientists use Openpyxl for data analysis, data copying, data mining, drawing charts, styling sheets, adding formulas, and more.

Workbook: A spreadsheet is represented as a workbook in openpyxl. A workbook consists of one or more sheets.

Sheet: A sheet is a single page composed of cells for organizing data.

Cell: The intersection of a row and a column is called a cell. Usually represented by A1, B5, etc.

Row: A row is a horizontal line represented by a number (1,2, etc.).

Column: A column is a vertical line represented by a capital letter (A, B, etc.).

Openpyxl can be installed using the pip command and it is recommended to install it in a virtual environment.

pip install openpyxl

CREATE A NEW WORKBOOK

We start by creating a new spreadsheet, which is called a workbook in Openpyxl. We import the workbook module from Openpyxl and use the function Workbook() which creates a new workbook.

from openpyxl
import Workbook
#creates a new workbook
wb = Workbook()
#Gets the first active worksheet
ws = wb.active
#creating new worksheets by using the create_sheet method

ws1 = wb.create_sheet("sheet1", 0) #inserts at first position
ws2 = wb.create_sheet("sheet2") #inserts at last position
ws3 = wb.create_sheet("sheet3", -1) #inserts at penultimate position

#Renaming the sheet
ws.title = "Example"

#save the workbook
wb.save(filename = "example.xlsx")

READING DATA FROM WORKBOOK

We load the file using the function load_Workbook() which takes the filename as an argument. The file must be saved in the same working directory.

#loading a workbook
wb = openpyxl.load_workbook("example.xlsx")

 

GETTING SHEETS FROM THE LOADED WORKBOOK

 

#getting sheet names
wb.sheetnames
result = ['sheet1', 'Sheet', 'sheet3', 'sheet2']

#getting a particular sheet
sheet1 = wb["sheet2"]

#getting sheet title
sheet1.title
result = 'sheet2'

#Getting the active sheet
sheetactive = wb.active
result = 'sheet1'

 

ACCESSING CELLS AND CELL VALUES

 

#get a cell from the sheet
sheet1["A1"] <
  Cell 'Sheet1'.A1 >

  #get the cell value
ws["A1"].value 'Segment'

#accessing cell using row and column and assigning a value
d = ws.cell(row = 4, column = 2, value = 10)
d.value
10

 

ITERATING THROUGH ROWS AND COLUMNS

 

#looping through each row and column
for x in range(1, 5):
  for y in range(1, 5):
  print(x, y, ws.cell(row = x, column = y)
    .value)

#getting the highest row number
ws.max_row
701

#getting the highest column number
ws.max_column
19

There are two functions for iterating through rows and columns.

Iter_rows() => returns the rows
Iter_cols() => returns the columns {
  min_row = 4, max_row = 5, min_col = 2, max_col = 5
} => This can be used to set the boundaries
for any iteration.

Example:

#iterating rows
for row in ws.iter_rows(min_row = 2, max_col = 3, max_row = 3):
  for cell in row:
  print(cell) <
  Cell 'Sheet1'.A2 >
  <
  Cell 'Sheet1'.B2 >
  <
  Cell 'Sheet1'.C2 >
  <
  Cell 'Sheet1'.A3 >
  <
  Cell 'Sheet1'.B3 >
  <
  Cell 'Sheet1'.C3 >

  #iterating columns
for col in ws.iter_cols(min_row = 2, max_col = 3, max_row = 3):
  for cell in col:
  print(cell) <
  Cell 'Sheet1'.A2 >
  <
  Cell 'Sheet1'.A3 >
  <
  Cell 'Sheet1'.B2 >
  <
  Cell 'Sheet1'.B3 >
  <
  Cell 'Sheet1'.C2 >
  <
  Cell 'Sheet1'.C3 >

To get all the rows of the worksheet we use the method worksheet.rows and to get all the columns of the worksheet we use the method worksheet.columns. Similarly, to iterate only through the values we use the method worksheet.values.


Example:

for row in ws.values:
  for value in row:
  print(value)

 

WRITING DATA TO AN EXCEL FILE

Writing to a workbook can be done in many ways such as adding a formula, adding charts, images, updating cell values, inserting rows and columns, etc… We will discuss each of these with an example.

 

CREATING AND SAVING A NEW WORKBOOK

 

#creates a new workbook
wb = openpyxl.Workbook()

#saving the workbook
wb.save("new.xlsx")

 

ADDING AND REMOVING SHEETS

 

#creating a new sheet
ws1 = wb.create_sheet(title = "sheet 2")

#creating a new sheet at index 0
ws2 = wb.create_sheet(index = 0, title = "sheet 0")

#checking the sheet names
wb.sheetnames['sheet 0', 'Sheet', 'sheet 2']

#deleting a sheet
del wb['sheet 0']

#checking sheetnames
wb.sheetnames['Sheet', 'sheet 2']

 

ADDING CELL VALUES

 

#checking the sheet value
ws['B2'].value
null

#adding value to cell
ws['B2'] = 367

#checking value
ws['B2'].value
367

 

ADDING FORMULAS

 

We often require formulas to be included in our Excel datasheet. We can easily add formulas using the Openpyxl module just like you add values to a cell.
 

For example:

import openpyxl
from openpyxl
import Workbook

wb = openpyxl.load_workbook("new1.xlsx")
ws = wb['Sheet']

ws['A9'] = '=SUM(A2:A8)'

wb.save("new2.xlsx")

The above program will add the formula (=SUM(A2:A8)) in cell A9. The result will be as below.

image

 

MERGE/UNMERGE CELLS

Two or more cells can be merged to a rectangular area using the method merge_cells(), and similarly, they can be unmerged using the method unmerge_cells().

For example:
Merge cells

#merge cells B2 to C9
ws.merge_cells('B2:C9')
ws['B2'] = "Merged cells"

Adding the above code to the previous example will merge cells as below.

image

UNMERGE CELLS

 

#unmerge cells B2 to C9
ws.unmerge_cells('B2:C9')

The above code will unmerge cells from B2 to C9.

INSERTING AN IMAGE

To insert an image we import the image function from the module openpyxl.drawing.image. We then load our image and add it to the cell as shown in the below example.

Example:

import openpyxl
from openpyxl
import Workbook
from openpyxl.drawing.image
import Image

wb = openpyxl.load_workbook("new1.xlsx")
ws = wb['Sheet']
#loading the image(should be in same folder)
img = Image('logo.png')
ws['A1'] = "Adding image"
#adjusting size
img.height = 130
img.width = 200
#adding img to cell A3

ws.add_image(img, 'A3')

wb.save("new2.xlsx")

Result:

image

CREATING CHARTS

Charts are essential to show a visualization of data. We can create charts from Excel data using the Openpyxl module chart. Different forms of charts such as line charts, bar charts, 3D line charts, etc., can be created. We need to create a reference that contains the data to be used for the chart, which is nothing but a selection of cells (rows and columns). I am using sample data to create a 3D bar chart in the below example:

Example

import openpyxl
from openpyxl
import Workbook
from openpyxl.chart
import BarChart3D, Reference, series

wb = openpyxl.load_workbook("example.xlsx")
ws = wb.active

values = Reference(ws, min_col = 3, min_row = 2, max_col = 3, max_row = 40)
chart = BarChart3D()
chart.add_data(values)
ws.add_chart(chart, "E3")
wb.save("MyChart.xlsx")

Result
image


How to Automate Excel with Python with Video Tutorial

Welcome to another video! In this video, We will cover how we can use python to automate Excel. I'll be going over everything from creating workbooks to accessing individual cells and stylizing cells. There is a ton of things that you can do with Excel but I'll just be covering the core/base things in OpenPyXl.

⭐️ Timestamps ⭐️
00:00 | Introduction
02:14 | Installing openpyxl
03:19 | Testing Installation
04:25 | Loading an Existing Workbook
06:46 | Accessing Worksheets
07:37 | Accessing Cell Values
08:58 | Saving Workbooks
09:52 | Creating, Listing and Changing Sheets
11:50 | Creating a New Workbook
12:39 | Adding/Appending Rows
14:26 | Accessing Multiple Cells
20:46 | Merging Cells
22:27 | Inserting and Deleting Rows
23:35 | Inserting and Deleting Columns
24:48 | Copying and Moving Cells
26:06 | Practical Example, Formulas & Cell Styling

📄 Resources 📄
OpenPyXL Docs: https://openpyxl.readthedocs.io/en/stable/ 
Code Written in This Tutorial: https://github.com/techwithtim/ExcelPythonTutorial 
Subscribe: https://www.youtube.com/c/TechWithTim/featured 

#python 

Eleo Nona

Eleo Nona

1574232259

Getting started with Directus 7 and Docker (PHP & MySQL & Nginx)

I recently wanted to try out the very promising Directus 7, a PHP based Headless CMS (Content Management System, headless meaning it creates an API to work with single page apps), without a doubt explained better on the Documentation.

To get started, I went to visit the very well written documentation, which tells that the best way to start is to git clone [https://github.com/directus/directus.git](https://github.com/directus/directus.git) and configure a local Apache Web Server and MySQL database to try it.

Not wanting to install it locally (because… well, who does that anymore? Local environments are the less reproducible things of all, everyone does not have the same OS, OS version, packages installed, etc.), I turned to my best development friend: Docker!

I found that there is an official Docker repository for directus (Yay!), but sadly couldn’t make it work properly, was out of date and just wasn’t easy to use.

I finally decided to write this article to help dear developper friends in this inquiry.

Our goal :

  • Setup a docker PHP container being able to run the latest Directus version
  • Setup a docker container hosting a MySQL DB to use with Directus
  • Making them work together and letting us try it

Requirements to achieve that goal :

TL;DR : You can find the result of this article here , get it and run the Start stuff instructions to try out Directus 7 in Docker 🙂

Setup a docker PHP container being able to run the latest Directus version

I have to say my favorite stack does not include Apache, I way prefer Nginx working with PHP-FPM, so that is what this example with showcase.

First, let’s create a folder for our experiment: mkdir directus-test/

Inside that folder ( cd directus-test/ ), let’s create a Dockerfile and start from an image that’s gonna help us out:

FROM wyveo/nginx-php-fpm:latest

Then, let’s install a very simple NGINX config allowing us to serve the directus code:

COPY default_nginx_conf /etc/nginx/conf.d/default.conf

The default_nginx_conf is the following:

server {
  listen 80;  root /app/public/;
  index index.php index.html index.htm;
  server_name _; 
  location / {
    try_files $uri $uri/ /index.php;
  }
  
  # pass the PHP scripts to FastCGI server 
  location ~ \.php$ {
    try_files $uri =404;
    fastcgi_pass unix:/run/php/php7.3-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
  }
}

Hence, a very simple NGINX configuration looking for an index.php in the /app/public folder of our container, and forwarding any request to a *.php file to PHP-FPM through a socket ( /run/php/php7.3-fpm.sock ) which is already set up in the container.

We’re just missing the directus code!

Let’s get it from github, as it is advised in the documentation :

git clone https://github.com/directus/directus.git

Let’s build our container!

docker build -t directus_img .

Setup a docker container hosting a MySQL DB to use with Directus

You know what? I feel lazy and would prefer to spend my time trying the damn thing, so let’s just get an image from Docker hub!

For example, the default MySQL image looks nice ! https://hub.docker.com/_/mysql

Making them work together and letting us try it

Let’s run both containers and make sure they can interact with each other thanks to a Docker Network:

docker network create directus_test_network

Then let’s run our PHP container and give it access to the directus code :

docker run -dit --name directus_php --network directus_test_network -p 8000:80 -v "$(pwd)/directus/":/app/ --rm directus_img

In case you are not familiar with docker, the options allow us to:

  • directus_img is the image we built just before, including all we need
  • -d detach the process from the command line, i.e. your bash is not “stuck” in the process
  • -i keeps the shell interactive even if detached, which means you can still interact with the container
  • -t allocates a pseudo-TTY
  • --name names the container so we can find it easily with docker ps later, or to interact with it
  • --network specifies that container should be available in the network created just before
  • -p allows us to bind ports from the container (80 : the default web port) to a port of the host (your machine), here the 8000 , making it possible for you to go to localhost:8000 and see what the container serves on its port 80
  • -v mounting a volume (here: $(pwd)/directus/ , $(pwd) being the current folder) as a folder in the container ( /app/ )
  • --rm Automatically removes the container when it exits

The fact that directus_img is a the very end of the command is NOT because it is linked to --rm , but simply because it is necessary to pass all the options to docker run before specifying which image to run.

Then, let’s run our MySQL container:

docker run -d --name directus_mysql --network directus_test_network -p 3306:3306 -e MYSQL_DATABASE=directus -e MYSQL_ROOT_PASSWORD=root -v data:"$(pwd)/data" --rm mysql:5.7

The only new thing here is the -e option, allowing you to pass an environment variable to the container.

You can see here that we also bind the port 3306 on the host… Why? This allows you to connect you favorite SQL Manager tool (ex: Sequel Pro) to the DB on localhost:3306 and browse your data if need be.

We can see that our containers are running thanks to docker ps , which should give you something like the following:

This is image title

Result of docker ps

You can now go to http://localhost:8000/admin and setup directus :

This is image title

Ready to install!

The first step is to choose your login and password:

Fill the settings for the admin login

Then to specify the database credentials and settings:

This is image title

Fill the database settings

The only parameters to change here are:

  • the host , which is going to be directus_mysql
  • the user and password : root and root

Which is where we see the influence of having the two containers in the same network. Indeed, having them in the same network makes them “aware” of each other, giving access in the MySQL container to the PHP container on the “host name” directus_php and giving the PHP container access to the MySQL one on directus_mysql .

The docker network with default driver actually includes a DNS resolver so the nslookup done to resolve the IP from the hostnames (e.g. directus_mysql) finds the other container within the same subnet based on the same container name.

Submit the login form with the credentials set and BOOM! You’re in!

This is image title

Boom, you’re in!

You can now access the Admin Settings at the bottom left of the screen and get started creating your collections, etc. 🚀

This is image title

Admin settings at the bottom left of the screen

I have to say that after that, Directus gives a great feeling, everything is pretty smooth with a few hiccups, like some buttons not working, but you get it, it’s still a Work in Progress :)

You can find “all of this code” plus a few helpers here if you don’t want to waste your time trying all of that out.

Thank you for reading !

#Docker #Directus #PHP #MySQL #Development

Joe  Hoppe

Joe Hoppe

1595905879

Best MySQL DigitalOcean Performance – ScaleGrid vs. DigitalOcean Managed Databases

HTML to Markdown

MySQL is the all-time number one open source database in the world, and a staple in RDBMS space. DigitalOcean is quickly building its reputation as the developers cloud by providing an affordable, flexible and easy to use cloud platform for developers to work with. MySQL on DigitalOcean is a natural fit, but what’s the best way to deploy your cloud database? In this post, we are going to compare the top two providers, DigitalOcean Managed Databases for MySQL vs. ScaleGrid MySQL hosting on DigitalOcean.

At a glance – TLDR
ScaleGrid Blog - At a glance overview - 1st pointCompare Throughput
ScaleGrid averages almost 40% higher throughput over DigitalOcean for MySQL, with up to 46% higher throughput in write-intensive workloads. Read now

ScaleGrid Blog - At a glance overview - 2nd pointCompare Latency
On average, ScaleGrid achieves almost 30% lower latency over DigitalOcean for the same deployment configurations. Read now

ScaleGrid Blog - At a glance overview - 3rd pointCompare Pricing
ScaleGrid provides 30% more storage on average vs. DigitalOcean for MySQL at the same affordable price. Read now

MySQL DigitalOcean Performance Benchmark
In this benchmark, we compare equivalent plan sizes between ScaleGrid MySQL on DigitalOcean and DigitalOcean Managed Databases for MySQL. We are going to use a common, popular plan size using the below configurations for this performance benchmark:

Comparison Overview
ScaleGridDigitalOceanInstance TypeMedium: 4 vCPUsMedium: 4 vCPUsMySQL Version8.0.208.0.20RAM8GB8GBSSD140GB115GBDeployment TypeStandaloneStandaloneRegionSF03SF03SupportIncludedBusiness-level support included with account sizes over $500/monthMonthly Price$120$120

As you can see above, ScaleGrid and DigitalOcean offer the same plan configurations across this plan size, apart from SSD where ScaleGrid provides over 20% more storage for the same price.

To ensure the most accurate results in our performance tests, we run the benchmark four times for each comparison to find the average performance across throughput and latency over read-intensive workloads, balanced workloads, and write-intensive workloads.

Throughput
In this benchmark, we measure MySQL throughput in terms of queries per second (QPS) to measure our query efficiency. To quickly summarize the results, we display read-intensive, write-intensive and balanced workload averages below for 150 threads for ScaleGrid vs. DigitalOcean MySQL:

ScaleGrid MySQL vs DigitalOcean Managed Databases - Throughput Performance Graph

For the common 150 thread comparison, ScaleGrid averages almost 40% higher throughput over DigitalOcean for MySQL, with up to 46% higher throughput in write-intensive workloads.

#cloud #database #developer #digital ocean #mysql #performance #scalegrid #95th percentile latency #balanced workloads #developers cloud #digitalocean droplet #digitalocean managed databases #digitalocean performance #digitalocean pricing #higher throughput #latency benchmark #lower latency #mysql benchmark setup #mysql client threads #mysql configuration #mysql digitalocean #mysql latency #mysql on digitalocean #mysql throughput #performance benchmark #queries per second #read-intensive #scalegrid mysql #scalegrid vs. digitalocean #throughput benchmark #write-intensive

Misael  Stark

Misael Stark

1629190508

Docker Compose To Run Laravel Application Using Nginx, PHP and MySQL

In this article, we are going to use Docker Compose to run our Laravel application using Nginx, PHP, and MySQL. In the end, we will get three separate service containers.

  • An app service container
  • A db service container to run MySQL
  • An nginx service container

#docker #nginx #mysql #laravel #php 

I am Developer

1597487472

Country State City Dropdown list in PHP MySQL PHP

Here, i will show you how to populate country state city in dropdown list in php mysql using ajax.

Country State City Dropdown List in PHP using Ajax

You can use the below given steps to retrieve and display country, state and city in dropdown list in PHP MySQL database using jQuery ajax onchange:

  • Step 1: Create Country State City Table
  • Step 2: Insert Data Into Country State City Table
  • Step 3: Create DB Connection PHP File
  • Step 4: Create Html Form For Display Country, State and City Dropdown
  • Step 5: Get States by Selected Country from MySQL Database in Dropdown List using PHP script
  • Step 6: Get Cities by Selected State from MySQL Database in DropDown List using PHP script

https://www.tutsmake.com/country-state-city-database-in-mysql-php-ajax/

#country state city drop down list in php mysql #country state city database in mysql php #country state city drop down list using ajax in php #country state city drop down list using ajax in php demo #country state city drop down list using ajax php example #country state city drop down list in php mysql ajax