0% found this document useful (0 votes)
16 views2 pages

Add Student

The document is a PHP script that handles the insertion of student data into a database. It retrieves student information from a form via GET parameters and executes an SQL query to insert the data into the 'student_tbl' table. The form collects details such as Student ID, last name, first name, middle name, and address.

Uploaded by

Rizchelle Gocor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views2 pages

Add Student

The document is a PHP script that handles the insertion of student data into a database. It retrieves student information from a form via GET parameters and executes an SQL query to insert the data into the 'student_tbl' table. The form collects details such as Student ID, last name, first name, middle name, and address.

Uploaded by

Rizchelle Gocor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

<?

php
include 'dbcon.php';

?>

<?php
if (isset($_GET['add']))
{
$sid = $_GET['sid'];
$lname = $_GET['lname'];
$fname = $_GET['fname'];
$mname = $_GET['mname'];
$address = $_GET['address'];

$sql= mysqli_query($con, "INSERT INTO student_tbl (sid,lname,fname,mname,address)


VALUES
('$sid','$lname','$fname','$mname','$address')" );

}
?>

<form>
<table>
<tr>
<td>Student ID:</td>
<td><Input type = "text" name = "sid"></td>
</tr>

<tr>
<td>Last Name:</td>
<td><Input type = "text" name = "lname"></td>
</tr>

<tr>
<td>First Name:</td>
<td><Input type = "text" name = "fname"></td>
</tr>

<tr>
<td>Middle Name:</td>
<td><Input type = "text" name = "mname"></td>
</tr>

<tr>
<td>Address:</td>
<td><Input type = "text" name = "address"></td>
</tr>

<tr>
<td><Input type = "Submit" name = "add" value= "Save"></td>
</tr>
</table>
</form>

You might also like