Db. func: & lt ;? FunctionGetRows ($ Database, $ Query) {& nbsp; mysql_connect (ftp, root,); & nbsp; $ dbmysql_select_db ($ Database); & nbsp; & nbsp; if (! $ Db) {& nbsp ;&
Db. func:
Function GetRows ($ Database, $ Query ){
Mysql_connect ("ftp", "root ","");
$ Db = mysql_select_db ($ Database );
If (! $ Db ){
Echo "cannot connect to the database! ";
Exit;
}
$ Rows = mysql_query ($ Query );
If (! $ Rows ){
Echo "SQL command error! ";
Exit;
}
Return $ rows;
}
Function ConnectDatabase ($ Database ){
Mysql_connect ("ftp", "root ","");
$ Db = mysql_select_db ($ Database );
If (! $ Db ){
Echo "cannot connect to the database! ";
Exit;
}
}
?>
Cratetable. php:
Function CreateTable (){
$ Link = mysql_connect ("ftp", "root ","");
$ Db = mysql_select_db ("pcadmin ");
If (! $ Db ){
Echo "failed to connect to database! ";
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:
? Input table ?? Lt;/title> <BR> <style type = "text/css"> <BR> <! -- <BR>. INPUT {<BR> border: 1px solid #003C74; <BR >}< BR>. font {<BR> font-family: "" "; <BR> font-size: 14px; <BR> color: # 0000FF; <BR> font-weight: lighter; <BR >}< BR>. table {<BR> border: 1px solid #000000; <BR >}< BR>. title {<BR> font-family: "" "; <BR> font-size: 14px; <BR> color: # FF0000; <BR >}< BR> --> <BR> </style> <BR> </pead> </P> <body> <center class = "title" >? Input table ?? BR> </center> <pr size = "1" noshade> <BR> </P> <pr size = "1" noshade> <BR> <p> </p> <BR> </body> <BR> </ptml> <BR> </P> <P> insert. php: </P> <HTML> <BR> <style type = "text/css"> <BR> <! -- <BR>. font {<BR> font-family: "" "; <BR> font-size: 14px; <BR> font-weight: lighter; <BR> color: # FF0000; <BR >}< BR> --> <BR> </style> <BR> <BODY bgcolor = "# FFFFFF"> <BR> success? Input 1 ?? Expected to see <BR> <? <BR> include ("../db. func"); </P> <P> if (! Empty ($ Send) {<BR> ConnectDatabase ("pcadmin"); <BR> $ SQL = "insert into Profile (Name, Produce, Lianluo, Tel, Email) values ($ Name, $ Produce, $ Lianluo, $ Tel, $ Email) "; <BR> mysql_query ($ SQL); <BR >}< BR >?> <BR> </BODY> <BR> </HTML> </P> <p> There are two pages in this news, currently on Page 1 2, 1st </p> <br> <p> </p> <P> show. php: </P> <? <BR> function ShowOnePage ($ rows, $ No) {<BR> mysql_data_seek ($ rows, $ No ); <BR> </P> <P> echo "<TABLE Border = 1 Align = Center bordercolordark = # ffffff bordercolorlight = #000000 cellpadding = 3 cellspacing = 0> "; <BR> echo "<TR BgColor = Cyan>"; <BR> while ($ field = mysql_fetch_field ($ rows) {<BR> echo "<TD> ". $ field-> name. "</TD>"; <BR >}< BR> echo "</TR>"; <BR> $ nums = mysql_num_rows ($ rows ); <BR> for ($ I = 1; $ I <= 10; $ I ++) {<BR> if ($ row = mysql_fetch_row ($ rows) {<BR> for ($ K = 0; $ K <count ($ row); $ K ++) {<BR> echo "<TD Align = Right> ". $ row [$ K]. "</TD>"; <BR >}< BR> echo "</TR> "; <BR >}< BR> echo "</TABLE>"; <BR >}< BR >?> </P> <HTML> <BR> <style type = "text/css"> <BR> <! -- <BR>. title {<BR> color: # FF0000; <BR> font-family: "" "; <BR> font-size: 14px; <BR >}< BR>. body {<BR> font-family: "" "; <BR> font-size: 12px; <BR> font-weight: lighter; <BR> color: # 0000FF; <BR >}< BR> --> <BR> </style> <BR> <title> Server List
Server clearance ?? Lt;/span>