We generally deal with different types of applications where there is a usage for inserting data into MySQL database and retrieving it.

So today i want to show you how to insert values into server.

 

 

Right from basic level we will see how to make php files and also database.   Lets start it by creating a database in MYSQL

 

Now we will see how to code in php to insert details into database but before to that we will connect out code to database with a connector file.   Php folder format AndroidCoding  –>  dbconnect.php, input.php (folder name)                       (php files)

dbconnect.php

 

Now using this file we will connect our php file.

input.php

 

 

Creating activity_main.xml file

Now  we will design a view where user will input details like name, country, email, hobbies.And after entering details a submit button for the form needs to be done.  

So now we have got database, php files for connecting and inserting now we will see java coding.   Now all the details like name, country, email, hobbies into arraylist as below.

Creating async class for inserting values into server.

Creating MainActivity.java file

This is final full coding for inserting details into mysql database.

Output :

insert1

 

 

insert2

Show Buttons
Hide Buttons
Read previous post:
Android Facebook Based Login Tutorial Part – 2

Close