文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Php应用实例--新增资料录到MySQL资料表

Php应用实例--新增资料录到MySQL资料表

时间:2007-02-17  来源:PHP爱好者

一,Insert.htm源码:<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Insert</title>
</head><body>
<p>Score资料表--新增资料录
</p>
<p><hr noshade></p>
<form name="form1" method="post" action="insert.htm">
<table width="200" 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="English"></td>
</tr>
<tr>
<td>Math</td>
<td><input type="text" name="Math"></td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="提交"></td>
<td>&nbsp;</td>
</tr>
</table>
</form>
<hr noshade>

</body>
</html>二,Insert.php源码:<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>insert</title>
</head><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);
?> 新增一笔资料成功,<a href="insert.htm">请反回</a>!
</body>
</html>所用到的SQL语句:insert into score (Number,Name,Chinese,English,Math) values ($Number,'$Name',$Chinese,$English,$Math)作者:(台湾)王国荣
php爱好 者站 http://www.phpfans.net php基础|php进阶|php模板.
相关阅读 更多 +
排行榜 更多 +
乐乐太空杀安卓版

乐乐太空杀安卓版

棋牌卡牌 下载
利刃战锤

利刃战锤

棋牌卡牌 下载
血债血偿2街头乱战Payback 2

血债血偿2街头乱战Payback 2

飞行射击 下载