澳门新葡萄京官网注册一个对数据库进行操作的程序

db.func:

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:htmlheadmeta content=text/html;
charset=gb2312title

?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:

htmlheadmeta “Content-Type” content=”text/html;
charset=gb2312″title入表/titlestyle 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

bodyh3center 入表/centerhr size=”1″ noshade/h3

form name=”form1″ method=”post” action=”insert.php”table
width=”400″align=centertr th scope=”row”div align=”left” 主名/div/th
tdinput name=”Name” type=”text” /td /tr tr th scope=”row”div
align=”left” 生商/div/th tdinput name=”Produce” type=”text” /td /tr tr
th scope=”row”div align=”left” 人/div/th tdinput name=”Lianluo”
type=”text” /td /tr tr th scope=”row”div align=”left” 人/div/th tdinput
name=”Tel” type=”text” /td /tr tr th scope=”row”div align=”left”
人箱/div/th tdinput name=”Email” type=”text” /td /tr tr &

发表评论

电子邮件地址不会被公开。 必填项已用*标注