您的位置:学习中国 推荐教程 正文
原作者:kuku 添加时间:2007-06-02 原文发表:2007-06-02 人气:8 来源:互联网

本文章共7089字,分5页,当前第1页,快速翻页:
 

db.func:

<?
function GetRows( $Database, $Query ) {
   mysql_connect ("ftp", "root", "");
   $db = mysql_select_db( $Database );

   if ( ! $db ) {
      echo "无法连结数据库!";
      exit;
   }

   $rows = mysql_query( $Query );
   if ( ! $rows ) {
      echo "SQL指令错误!";
      exit;
   }
   return $rows;
}

function ConnectDatabase( $Database ) {
   mysql_connect ("ftp", "root", "");
   $db = mysql_select_db( $Database );
   if ( ! $db ) {
      echo "无法连结数据库!";
      exit;
   }
}
?>

cratetable.php:

<?
function CreateTable() {
   $link = mysql_connect ("ftp", "root", "");
   $db = mysql_select_db("pcadmin");
   if ( ! $db ) {
      echo "连接到数据库失败!";
      exit;
   }
   $rows = mysql_query("select * from Profile");
   if ( ! $rows ) {
      $sql = "Create Table Profile (ID integer auto_increment primary key,Name char(255),Produce char(255),Lianluo char(255),Tel integer(15),Email char(255))";
      mysql_query($sql);
   }
  
   $rows = mysql_query("select * from Aplication");
   if ( ! $rows ) {
      $sql = "Create Table Aplication(Name char(255) primary key,IP char(255),Ap char(255),Directory char(255))";
      mysql_query($sql);
   }
   mysql_close ($link);
}
CreateTable();
?>

input.htm:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>輸入表單</title>
<style type="text/css">
<!--
.INPUT {
 border: 1px solid #003C74;
}
.font {
 font-family: "新宋体";
 font-size: 14px;
 color: #0000FF;
 font-weight: lighter;
}
.table {
 border: 1px solid #000000;
}
.title {
 font-family: "新宋体";
 font-size: 14px;
 color: #FF0000;
}
-->
</style>
</head>

<body><h3><center class="title">輸入表單
</center><hr size="1" noshade>
</h3>

<form name="form1" method="post" action="insert.php">
<table width="400"align=center>
 <tr>
    <th scope="row"><div align="left" class="font">主機名稱</div></th>
    <td><input name="Name" type="text" class="input"></td>
 

本文章更多内容1 - 2 - 3 - 4 - 5 - 下一页>>
本页地址
相关文章

PHP编写网站程序的十个经验技巧
PHP+MySQL扎实基本功
PHP实例:email address 生成图片程序
win2k下搭建jsp环境
利用iText在JSP中生成PDF报表
JSP中图片验证的实现
缓冲技术提高JSP程序性能和稳定性<2>
缓冲技术提高JSP程序性能和稳定性<1>
JSP与XML的结合<3>
JSP与XML的结合<2>
身份证方面的函数
几个php技巧
用PHP写FTP文件上传
Win XP下全新安装Apache2,PHP5,MYSQL5
用PHP写的MD5加密函数
关于session的问题集锦解决方案
在php中输出html代码
自己写的mysql类
使用PHP和XSL stylesheets转换XML文档
使用PHP实现动态网页

相关评论


本文章所属分类:首页 推荐教程   PHP编程