how o used insert query
<?php
mysql_connect("localhost","root","");
mysql_select_db("php1");
if (isset($_POST["n6"])){
$name = $_POST["n"];
$surname = $_POST["n1"];
$email = $_POST["n3"];
$password = $_POST["n4"];
$hobyes = $_POST["n5"];
$address = $_POST["n2"];
$q = "insert into hobyes (name, surname, email, password, hobyes, address ) values ('$name', '$surname', '$email', '$password', '$hobyes', '$address')";
mysql_query($q);
echo"welcome";
}
?>
<?php
mysql_connect("localhost","root","");
mysql_select_db("php1");
if (isset($_POST["n6"])){
$name = $_POST["n"];
$surname = $_POST["n1"];
$email = $_POST["n3"];
$password = $_POST["n4"];
$hobyes = $_POST["n5"];
$address = $_POST["n2"];
$q = "insert into hobyes (name, surname, email, password, hobyes, address ) values ('$name', '$surname', '$email', '$password', '$hobyes', '$address')";
mysql_query($q);
echo"welcome";
}
?>
<body>
<div class="header" align="center" >
<div class="menu" >
<form action="" method="POST"><pre style="color:#FF0"><b>
<table border="1">
Name<input type="text" name="n" /><br />
Sur name<input type="text" name="n1" /><br />
E-mail<input type="email" name="n3" /><br />
Password<input type="password" name="n4" /><br />
Hobyes<input type="radio" name="n5" value="circket"/>circket<input type="radio" name="n5" value="chess" />chess<br />
Address<textarea name="n2"></textarea>
<br />
<input type="submit" name="n6" value="submit" />
</table>
</form></b></pre>
</div>
</div>
</body>
No comments:
Post a Comment