Insert data into sql server database using html?

Posted by Anilbabu.M under HTML 5 on 9/18/2012 | Points: 10 | Views : 5166 | Status : [Member] | Replies : 3
Insert data into sql server database using html?
It is possible ?
I am using VS2010

I am using Only html controls not asp.net controls?
Give me one example,insert data into database using html controls to sqlserver database

Anybody help me...............

zzcc


Responses

Posted by: Hariinakoti on: 9/18/2012 [Member] Starter | Points: 25

Up
0
Down
see this link:
http://www.tutorialspoint.com/php/mysql_insert_php.htm

Thanks & Regards
Hari

Anilbabu.M, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muhsinathk on: 9/18/2012 [Member] Bronze | Points: 25

Up
0
Down

<html>
<head>
<title>Insert data into database</title>
</head>
<body>
<?php

// Connect to database server
mysql_connect("mysql.myhost.com", "user", "sesame") or die (mysql_error ());

// Select database
mysql_select_db("mydatabase") or die(mysql_error());

// The SQL statement is built

$strSQL = "INSERT INTO people(";

$strSQL = $strSQL . "FirstName, ";
$strSQL = $strSQL . "LastName, ";

$strSQL = $strSQL . "Phone, ";
$strSQL = $strSQL . "BirthDate) ";

$strSQL = $strSQL . "VALUES(";

$strSQL = $strSQL . "'Gus', ";

$strSQL = $strSQL . "'Goose', ";
$strSQL = $strSQL . "'99887766', ";

$strSQL = $strSQL . "'1964-04-20')";

// The SQL statement is executed
mysql_query($strSQL) or die (mysql_error());

// Close the database connection
mysql_close();
?>

<h1>The database is updated!</h1>
</body>
</html>

Anilbabu.M, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hariinakoti on: 9/18/2012 [Member] Starter | Points: 25

Up
0
Down
Good work Muhsinathk.U know all languages & technologies? great yar


Thanks & Regards
Hari

Anilbabu.M, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response