Mysql| Application Example
One, insert.htm Source:
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title>Insert</title>
<body>
<p>score Data Sheet--new record
</p>
<P><HR noshade></p>
<form name= "Form1" method= "Post" action= "insert.htm" >
<table width= border= "0" align= "center" >
<tr>
<td>Number</td>
<td><input type= "text" name= "number" ></td>
</tr>
<tr>
<td>Name</td>
<td><input type= "text" name= "name" ></td>
</tr>
<tr>
<td>Chinese</td>
<td><input type= "text" name= "Chinese" ></td>
</tr>
<tr>
<td>English</td>
<td><input type= "text" name= "中文版" ></td>
</tr>
<tr>
<td>Math</td>
<td><input type= "text" name= "Math" ></td>
</tr>
<tr>
<td><input type= "Submit" name= "Submission" value= "submitted" ></td>
<td> </td>
</tr>
</table>
</form>
<HR noshade>
</body>
Second, insert.php Source:
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title>insert</title>
<body>
<?php
Mysql_connect ("ftp", "Root", "");
mysql_select_db ("test");
$sql = "INSERT INTO score (Number,name,chinese,english,math) VALUES ($Number, ' $Name ', $Chinese, $English, $Math)";
mysql_query ($sql);
?> new information to succeed, <a href= "insert.htm" > Please back </a>!
</body>
SQL statements used: INSERT INTO score (Number,name,chinese,english,math) VALUES ($Number, ' $Name ', $Chinese, $English, $Math)