⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 install.php.bak

📁 简单实现网上选课
💻 BAK
字号:
<?PHP
// check if we have to update or even preupdate:
if (!empty($_GET["action"]))
	$action = $_GET["action"];
if (!empty( $_GET["preUpdate"]))
	$preUpdate = $_GET["preUpdate"];
if (!empty($_GET["special"]))
	$special = $_GET["special"];
// let the config.php connect to the database.
include("config.php");
// make the signup table
	$query = "create table Info_course (Course_id varchar(50) primary key,Course_name   varchar(50) not null,Teacher_name  varchar(50) not null,Teacher_id    varchar(50) not null,CollectedMan 	int,Capacity 	int,Course_time varchar(50),Course_place varchar(50),credit  float)";  
	$result = mysql_query($query); 
	// check it it was succesfull
	if ($result == 1){echo "signup Table succesfully created.<br>";}
	// if it wasn't succesfull print the errornumer (with mysql_errno()) and an description of the error (with mysql_error())
	else{echo "Error while creating signup table (Errornumber ". mysql_errno() .": \"". mysql_error() ."\")<br>";}


	$query = "create table Info_student(Student_name varchar(20) primary key,
                   Student_id varchar(50) not null,
                   Dept  varchar(40) ,
                   Major  varchar(40),
                  
                   sex char(4) ,
                   class varchar(20),
                   password varchar(20))";  
	$result = mysql_query($query); 
	// check it it was succesfull
	if ($result == 1){echo "signup Table succesfully created.<br>";}
	// if it wasn't succesfull print the errornumer (with mysql_errno()) and an description of the error (with mysql_error())
	else{echo "Error while creating signup table (Errornumber ". mysql_errno() .": \"". mysql_error() ."\")<br>";}
	
	$query = "create table Info_teac(Teacher_name varchar(20) primary key,
                   Teacher_id varchar(50) not null,
                   Dept  varchar(40) ,
                   sex char(4) ,
                   Zhicheng  varchar(20),
                   password varchar(20))";  
	$result = mysql_query($query); 
	// check it it was succesfull
	if ($result == 1){echo "signup Table succesfully created.<br>";}
	// if it wasn't succesfull print the errornumer (with mysql_errno()) and an description of the error (with mysql_error())
	else{echo "Error while creating signup table (Errornumber ". mysql_errno() .": \"". mysql_error() ."\")<br>";}

	
	$query = "create table Info_admin( Admin_no varchar(20) primary key,
                   Admin_name varchar(50) not null,
                   password varchar(20))";  
	$result = mysql_query($query); 
	// check it it was succesfull
	if ($result == 1){echo "signup Table succesfully created.<br>";}
	// if it wasn't succesfull print the errornumer (with mysql_errno()) and an description of the error (with mysql_error())
	else{echo "Error while creating signup table (Errornumber ". mysql_errno() .": \"". mysql_error() ."\")<br>";}

   $query = "create table selected(Stu_name varchar(50) not null,
                   Stu_id varchar(50) not null,
                   Dept  varchar(50) ,
                   
                   class varchar(50),
                   Major varchar(50),
                   Course_name  varchar(50),
                   Course_id    varchar(50),
                   primary key (Course_id,Stu_id))";  
	$result = mysql_query($query); 
	// check it it was succesfull
	if ($result == 1){echo "signup Table succesfully created.<br>";}
	// if it wasn't succesfull print the errornumer (with mysql_errno()) and an description of the error (with mysql_error())
	else{echo "Error while creating signup table (Errornumber ". mysql_errno() .": \"". mysql_error() ."\")<br>";}


	


// Print htat the installation is done if so, else print a failure message
if ($result == 1  && $result4 == 1 && $result5 == 1 && $result6 == 1 && $result7 == 1){echo "Installation succesfull!";}else
{echo "There where some errors while installing Advance Login System";}

echo "<br><br><strong> DO NOT FORGET TO REMOVE THIS FILE AFTER THE INSTALLATION!!! </strong>";
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -