Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 网站建设 > PHP > Php应用实例--新增资料录到MySQL资料表
【标  题】:Php应用实例--新增资料录到MySQL资料表
【关键字】:Php,MySQL
【来  源】:http://blog.chinaunix.net/article.php?articleId=12397&blogId=674

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

Your Ad Here

一,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应用实例--分页的技巧:【上一篇】
我和PHP——不得不说的故事:【下一篇】
【相关文章】
  • Php应用实例--分页的技巧
  • linux下用php连接sqlserver解决办法
  • PHP常用函数
  • PHP-Push技术实现刷新功能 转载
  • I LOVE PHP!
  • php 分析rss代码一段
  • 关于PHP的分页代码
  • 简易投票系统 php+文本
  • win2k下Apache2+PHP4+MySql配置
  • php学习第一课---mysql的应用
  • 【随机文章】
  • Linux日志式文件系统面面观
  • WinRoute安装指南
  • 关于 2.6 内核升级
  • 机械综合制图:棘轮
  • PXPerl
  • 找不到你的VIM配置文件??
  • 安装配置net-snmp
  • Server.Transfer VS Response.Redirect (重定向)
  • vmware四种网络连接
  • 用Visual InterDev规划站点
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 软讯网络 All Rigths Reserved.