Showing posts with label insert query. Show all posts
Showing posts with label insert query. Show all posts

Friday, 16 September 2016

how o used insert query

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";
}
?>

<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>

Monday, 12 September 2016

How to used basic Insert query in input field

How to used basic Insert query in input field


<head>
<?php
// database connection
mysql_connect("localhost","root","");

//database sel
mysql_select_db("php");
if(isset($_POST["n1"])){

$name = $_POST["n"];
$address = $_POST["n3"];
$email = $_POST["n2"];
$password = $_POST["n5"];


$q = "insert into advanc_ephp (name, address, email, password) value ('$name', '$address', '$email', '$password')";
mysql_query($q);
echo'<h3 align="center">registration sussessfully</h3>';
}


?>

</head>

<body>
<form action="" method="post" ><pre>
   name<input type="text" name="n"  />
   address<input type="text" name="n3"  />
  email<input type="email" name="n2"  />
password<input type="password" name="n5"   />
<input type="submit" name="n1"  value="submit" />
</pre>
</form>


</body>