Php MySql Connection

if(isset($_POST[‘btnSave’]))  //isset checked button Sent True or Null
$A = $_POST[‘txtName’];
$B = $_POST[‘txtPhone’];
$C = $_POST[‘txtEmail’];
$D = $_POST[‘txtNIC’];
$CN = mysql_connect(“LocalHost”,”root”,””);
mysql_select_db(“AirLineDB”,$CN);  //AirLineDB is Database name
mysql_query(“Insert into tblStudent values (”,’$A’,’$B’,’$C’,’$D’)”,$CN);  //tblStudent is Table Name
echo “Data Saved…”;

<h2 align=center>Enter Student Information</h2>
<form action=”Register.php” Method=”POST”>
<table border=1 cellPadding=5 cellSpacing=5 align=center>
<td bgcolor=aqua>Name</td>
<td><input type=Text name=txtName Required></td>
<td bgcolor=aqua>Phone</td>
<td><input type=Text name=txtPhone Required></td>
<td bgcolor=aqua>Email</td>
<td><input type=Text name=txtEmail Required></td>
<td bgcolor=aqua>N-I-C</td>
<td><input type=Text name=txtNIC Required></td>
<td bgcolor=aqua>.</td>
<td><input type=Submit name=btnSave Value=Save></td>


It's Great To Hear From You

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s