I am unable to enter data from HTML into a mysql table.
There are two files: an HTML file in which I made a form of three text fields and a submit button, and a php file for which I establish a connection to the database and through INSERT INTO I try to add a row in the table.
Here is the php code:
<?php echo "Hello World"; $connection = new mysqli('localhost' , 'root' ,'','accounts') or die("problem"); $valueFirst = $_POST['First']; $valueLast = $_POST['Last']; $valueKey = $_POST['Keywords']; $imsql = "INSERT INTO users (First,Last,Keywords) VALUES ('$valueFirst', '$valueLast', '$valueKey') "; echo "Hello 777"; ?> The connection works, but the data is not added.
How to make the machine understand from which fields to take data. How to link HTML-form with php-code?
If possible, write sample codes.