Friday, January 10, 2014

Registration Form: Inserting Data in PHP Database

 How To Insert New Data In Data Base In PHP

Sample Code
<html>
<head>
<title>Registration form</title>
</head>
<body>
<?php
$con=mysql_connect("localhost","root","");
$mysql_select_db("kiu");
$result=mysql_query("select * from student");
while($row=mysql_fetch-array($result))
if(mysql_connect_errno())
{
echo:"Failed tro connect to database".mysql_connect_error();
}
else
{
$sql:"INSERT INTO student values('$Reg_no','$Name','$F.name', '$password','$D_o_B','$Email')";

$query = mysql_query($sql);
if($query)
     echo $name . " has been added successfully";
else
echo "There was an error while inserting user to the database.";
}


</table>
</body>


</html>

Related Posts:

  • Login Form Code in PHP<?php include "settings.php"; ?> <html> <head> <title>Login System</title> <style type="text/css"> #container { position: relative; width: 500px; margin: 0px auto; height… Read More
  • Simplest jQuery Slideshow Code Simplest jQuery Slideshow Code <html "> <head> <title>Simplest jQuery Slideshow</title> <style> body {font-family:Arial, Helvetica, sans-serif; font-size:12px;} .fadein {  posit… Read More
  • LOGIN Form Login form with css and Database connectivity and sql file Free download the zip folder  :click to download … Read More
  • PHP code to View comments PHP code to View comments in web site <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> &l… Read More
  • PHP login Form with css  Php Login form with css and data base connectivity <?php include "settings.php"; ?> <html> <head> <title>Login System</title> <style type="text/css"> #container { positio… Read More

0 comments:

Post a Comment