How to insert data permanently in DB using Mysql
Step 1: Create a HTML form using .php extension. for e.g.
<html>
<body>
<form name="Registration" action="" method="post">
<table border="1" width="50%" cell spacing="0" cell padding="0">
<tr>
<td>
<table>
<tr>
<td><h1 align="center">REGISTRATION</h1></td>
</tr>
<tr>
<td>NAME:</td>
<td><input type="text" name="name" size="20" id="name"></td>
</tr>
<tr>
<td>USERNAME:</td>
<td><input type="text" name="uname" size="20" id="uname"></td>
</tr>
<tr>
<td align="center"><input type="submit" name="submit" value="submit" ></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
Step 2: Create a database in PHPmyadmin.
Step 3: Create a table in database.
Step 4: Make a connection file in common file. for e.g.:
<?php
$conn=mysql_connect("localhost","root","");
if(!$conn)
{
die('couldnot connect:'.mysql_error());
}
mysql_select_db("online_property",$conn);
?>
Step 5:
1. Call a connection file on the top.
<?php include ("include/connection.php");
No comments:
Post a Comment