Check out example codes for "how to insert data from a from in html to phpmyadmin using php". It will help you in understanding the concepts better.

Code Example 1

$host = "localhost";
$username = "username";
$pass = "";

// Create connection

  die("Data connection error");

Code Example 2

$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);

 // Check connection

 if ($conn->connect_error) {

    die("Connection failed: " . $conn->connect_error);

$sql = "INSERT INTO MyGuests (firstname, lastname, email)

 VALUES ('John', 'Doe', '[email protected]')";

if ($conn->query($sql) === TRUE) {
    echo "New record created successfully";
} else {
    echo "Error: " . $sql . "<br>" . $conn->error;



Code Example 3

<!DOCTYPE html>
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Contact Form - PHP/MySQL Demo Code</title>

<legend>Contact Form</legend>
<form name="frmContact" method="post" action="contact.php">
<label for="Name">Name </label>
<input type="text" name="txtName" id="txtName">
<label for="email">Email</label>
<input type="text" name="txtEmail" id="txtEmail">
<label for="phone">Phone</label>
<input type="text" name="txtPhone" id="txtPhone">
<label for="message">Message</label>
<textarea name="txtMessage" id="txtMessage">

Learn ReactJs, React Native from