时间:2021-07-01 10:21:17 帮助过:3人阅读
"; 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 " | ";
";
echo "管理"; echo "
";echo $my[0];echo " | ";$my[1] | ";";echo $my[2];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 ""; }
if($submit1!="有效"&&$submit3!="删除")
{ 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 ""; }
else
{ $db =mysql_connect("localhost", "root","391450");
mysql_select_db("class",$db);
$sql="delete from poll where poll_id='$sele'";
$result = mysql_query($sql);
$sql="delete from pollsele where pollsele_poll_id='$sele'";
mysql_query($sql);
mysql_close();
echo ""; }
}
?>
--------------------------------------------------------------------
pollsele.php //添加选项
$db =mysql_connect("localhost", "root","391450");
mysql_select_db("class",$db);
$sql="select pollsele_id,pollsele_name,pollsele_del,pollsele_num from pollsele where pollsele_poll_id='$id'";
echo "
";echo $my[0];echo " | ";$my[1] | ";";echo $my[2];echo " | ";";echo $my[3];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 ""; }
if($submit1!="有效"&&$submit3!="无效")
{ 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 ""; }
?>
----------------------------------------------------------------------
pollsee.php //投票结果
if ($toupiao!=""){
$db =mysql_connect("localhost", "root","391450");
mysql_select_db("class",$db);
$sql="select Pollsele_Name,pollsele_num from pollsele where pollsele_name='$toupiao'";
@$result = mysql_query($sql);
$myrow=mysql_fetch_row($result);
$poll_num=$myrow[1];
$poll_num=$poll_num+1;
$sql="update pollsele set Pollsele_num='$poll_num' where pollsele_name='$toupiao'";
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 $myrow[0];echo " | ";echo $myrow[1]; echo " |
http://www.bkjia.com/PHPjc/316512.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/316512.htmlTechArticle投票管理程序 表结构 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 polls...