## EX.NO: 09 Create an Employee database with two fields Employer’s Name, Employee’s Name with MySql and insert two records into those fields using PHP CODE. ### Aim To create a database in MySQL to store employer and employee information and use PHP code to insert two records into the database. ### Algorithm 1. Start. 2. Assign the server name, username, password, database name, and connection variables with the required values. 3. Check whether the connection was successful. * If not, print “Connection failed”. * Otherwise, proceed to Step 4. 4. Insert a record and assign the SQL query to the SQL object. 5. Check the execution of the query using the connection object. * If successful, print “Record inserted successfully”. * Otherwise, print “Error”. 6. Close the connection. 7. Stop. ## Program ### `insert.php` HTML ``` Insert Data




``` ### `Main.php` ``` ``` ### Output The form is displayed with fields for: * Name * Email Id * Mobile-number * Department After entering the details and submitting the form, the record is inserted into the database and the message “Passed” is displayed. ### Result Hence, the PHP/MySQL program to insert a record into a database table is executed and the output is verified.