linux服务器配置与管理 投票管理程序
程序员文章站
2022-05-19 16:58:38
...
投票管理程序
表结构
CREATE TABLE poll(Poll_Id INT (11) not null AUTO_INCREMENT,Poll_Name char(50) ,Poll_Del INT (10) DEFAULT '0' , PRIMARY KEY (Poll_Id))
CREATE TABLE pollsele(Pollsele_Id INT (11) not null AUTO_INCREMENT,Pollsele_Name char(50) ,Poll_Del INT (10) DEFAULT '0' , Pollsele_poll_Id INT (10) ,pollsele_num int (10), PRIMARY KEY (Pollsele_Id))
-------------------------------------------------------------------------------------------------
poll.php //主程序
$db =mysql_connect("localhost", "root","391450");
mysql_select_db("class",$db);
$sql="select poll_id,Poll_Name from poll where poll_del='1'";
@$result = mysql_query($sql);
$myrow=mysql_fetch_row($result);
echo "";
";
mysql_close();
echo "
";
echo "
-----------------------------------------------------------------------
poll_input.php //添加主题
$db =mysql_connect("localhost", "root","391450");
mysql_select_db("class",$db);
$sql="select poll_id,poll_name,poll_del from poll";
echo "";
";
?>
if($submit2!="添加")
{ echo "
else
{$db =mysql_connect("localhost", "root","391450");
mysql_select_db("class",$db);
$sql="select poll_name from poll where poll_name='$title'";
mysql_query($sql);
$sql="insert into poll values('','$title','')";
mysql_query($sql);
mysql_close();
echo "";
echo "设置主题:";
echo "";
echo "";
echo "";
echo "";
echo "";
}
else
{
if($submit1=="有效")
{
$db =mysql_connect("localhost", "root","391450");
mysql_select_db("class",$db);
$sql="update poll set Poll_Del='0'";
$result = mysql_query($sql);
$sql="update poll set Poll_Del='1' where poll_id='$sele'";
$result = mysql_query($sql);
mysql_close();
echo "";
@$result=mysql_query($sql);
while($my=mysql_fetch_row($result))
{
echo "";echo "";echo $my[0];echo " ";
echo "$my[1] ";
echo "";echo $my[2];echo " ";
echo "";echo $my[3];echo " ";
echo " ";
} echo "";
?>
if($submit2!="添加")
{ echo "
else
{$db =mysql_connect("localhost", "root","391450");
mysql_select_db("class",$db);
$sql="insert into pollsele values('','$title','','$id','')";
mysql_query($sql);
mysql_close();
echo "";
echo "设置选项:";
echo "";
echo "";
echo "";
echo "";
echo "";
}
else
{ $db =mysql_connect("localhost", "root","391450");
mysql_select_db("class",$db);
if ($submit1=="有效")
{
$sql="update pollsele set Pollsele_Del='0' where pollsele_id='$sele'";
$result = mysql_query($sql);}
else
{
$sql="update pollsele set Pollsele_Del='1' where pollsele_id='$sele'";
$result = mysql_query($sql); }
mysql_close();
echo "mysql_query($sql);
$sql="select Poll_Name from poll where poll_id='$poll_id'";
@$result = mysql_query($sql);
$title=mysql_fetch_row($result);
echo "
echo "
";
$sql="select Pollsele_Name,pollsele_num from pollsele where pollsele_del='0' and pollsele_poll_id='$poll_id'";
@$result = mysql_query($sql);
echo "";
"; }
else
{echo "你不能投空票!!!";}
?>
【本文版权归作者与奥索网共同拥有,如需转载,请注明作者及出处】
表结构
CREATE TABLE poll(Poll_Id INT (11) not null AUTO_INCREMENT,Poll_Name char(50) ,Poll_Del INT (10) DEFAULT '0' , PRIMARY KEY (Poll_Id))
CREATE TABLE pollsele(Pollsele_Id INT (11) not null AUTO_INCREMENT,Pollsele_Name char(50) ,Poll_Del INT (10) DEFAULT '0' , Pollsele_poll_Id INT (10) ,pollsele_num int (10), PRIMARY KEY (Pollsele_Id))
-------------------------------------------------------------------------------------------------
poll.php //主程序
$db =mysql_connect("localhost", "root","391450");
mysql_select_db("class",$db);
$sql="select poll_id,Poll_Name from poll where poll_del='1'";
@$result = mysql_query($sql);
$myrow=mysql_fetch_row($result);
echo "
"; echo "$myrow[1]"; $sql="select Pollsele_Name,pollsele_poll_id from pollsele where pollsele_del='0' and pollsele_poll_id='$myrow[0]'"; @$result = mysql_query($sql); echo ""; echo " | ";
mysql_close();
echo "
";
echo "
";
echo "管理"; echo "
-----------------------------------------------------------------------
poll_input.php //添加主题
$db =mysql_connect("localhost", "root","391450");
mysql_select_db("class",$db);
$sql="select poll_id,poll_name,poll_del from poll";
echo "
";echo $my[0];echo " | ";$my[1] | ";";echo $my[2];echo " | ";
?>
if($submit2!="添加")
{ echo "
";
echo "
else
{$db =mysql_connect("localhost", "root","391450");
mysql_select_db("class",$db);
$sql="select poll_name from poll where poll_name='$title'";
mysql_query($sql);
$sql="insert into poll values('','$title','')";
mysql_query($sql);
mysql_close();
echo "";
echo "设置主题:";
echo "";
echo "";
echo "";
echo "";
echo "";
}
else
{
if($submit1=="有效")
{
$db =mysql_connect("localhost", "root","391450");
mysql_select_db("class",$db);
$sql="update poll set Poll_Del='0'";
$result = mysql_query($sql);
$sql="update poll set Poll_Del='1' where poll_id='$sele'";
$result = mysql_query($sql);
mysql_close();
echo "";
@$result=mysql_query($sql);
while($my=mysql_fetch_row($result))
{
echo "
echo "
echo "
echo "
echo "
} echo "";
?>
if($submit2!="添加")
{ echo "
";
echo "
else
{$db =mysql_connect("localhost", "root","391450");
mysql_select_db("class",$db);
$sql="insert into pollsele values('','$title','','$id','')";
mysql_query($sql);
mysql_close();
echo "";
echo "设置选项:";
echo "";
echo "";
echo "";
echo "";
echo "";
}
else
{ $db =mysql_connect("localhost", "root","391450");
mysql_select_db("class",$db);
if ($submit1=="有效")
{
$sql="update pollsele set Pollsele_Del='0' where pollsele_id='$sele'";
$result = mysql_query($sql);}
else
{
$sql="update pollsele set Pollsele_Del='1' where pollsele_id='$sele'";
$result = mysql_query($sql); }
mysql_close();
echo "mysql_query($sql);
$sql="select Poll_Name from poll where poll_id='$poll_id'";
@$result = mysql_query($sql);
$title=mysql_fetch_row($result);
echo "
";
echo $title[0]; echo "
echo "
";
$sql="select Pollsele_Name,pollsele_num from pollsele where pollsele_del='0' and pollsele_poll_id='$poll_id'";
@$result = mysql_query($sql);
echo "
"; echo $myrow[0];echo " |
";echo $myrow[1]; echo " |
else
{echo "你不能投空票!!!";}
?>
【本文版权归作者与奥索网共同拥有,如需转载,请注明作者及出处】
以上就介绍了linux服务器配置与管理 投票管理程序,包括了linux服务器配置与管理方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
推荐阅读
-
Linux server配置安装Java与Tomcat服务器教程详解
-
Linux NFS服务器安装与配置思路分析
-
Linux NFS服务器的安装与配置方法(图文详解)
-
CentOS(Linux)下的apache服务器配置与管理方法分享
-
Linux CentOS服务器搭建与初始化配置教程
-
详解Supervisor安装与配置(Linux/Unix进程管理工具)
-
Linux下Varnish缓存服务器的安装与配置教程
-
浅析linux下apache服务器的配置和管理
-
window服务器上mongodb的安装与如何将mongodb设置为服务,为mongodb设置管理用户,mongodb连接字符串配置
-
linux服务器下LNMP安装与配置方法