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 instruction 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 the 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 (+), 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 form
Input form
insert.php:
Successfully entered a piece of information to see
Include (".. /db.func ");
if (!empty ($Send)) {
Connectdatabase ("Pcadmin");
$sql = "INSERT into profile (Name,produce,lianluo,tel,email) VALUES ($Name, $Produce, $Lianluo, $Tel, $Email)";
mysql_query ($sql);
}
?>
This news a total of 2 pages, currently on the 1th page 1 2
show.php:
function Showonepage ($rows, $No) {
Mysql_data_seek ($rows, $No);
echo "
"; echo "
"; while ($field = Mysql_fetch_field ($rows)) {echo "
" . $field->name. " | "; } echo "
"; $nums = mysql_num_rows ($rows); for ($I =1; $I <=10; $I + +) {if ($row = Mysql_fetch_row ($rows)) {for ($K =0; $K < count ($row); $K + +) {echo "
" . $row [$K]. " | "; } echo "
"; } } echo "
";
}
?>
server list
server checklist
http://www.bkjia.com/PHPjc/532634.html www.bkjia.com true http:// www.bkjia.com/PHPjc/532634.html techarticle db.func:?" function GetRows ($Database, $Query) {mysql_connect ("ftp", "Root", ""); $db = mysql_select_db ($Database); if (! $db) {echo ' cannot connect to the database! "; Exit } $r ...