投票管理程序
表格結構
CREATE TABLE poll(Poll_Id INT (11) not null AUTO_INCRMENT,Poll_Name char(50) ,Poll_Del INT (10) DEFAULT '0' , PRIMARY K; TABLE pollsele(Pollsele_Id INT (11) not null AUTO_INCRMENT,Pollsele_Name char(50) ,Poll_Del INT (10) DEFAULT '0' , Pollsele_poll_Id INT (10) ,pollsele_num int (10) -------------------------------------------------- -------------------------------------------------- --------
民調.php //主程式
$db =mysql_connect("localhost", "root","391450");
mysql_select_db("class",$db);
$sql="select poll_id,Poll_Name from poll where poll_del='1'";
@$結果 = mysql_query($sql);
$myrow=mysql_fetch_row($result);
echo "";
echo "";
echo "$myrow[1]";
$sql="select Pollsele_Name,pollsele_poll_id from pollsele where pollsele_del='0' and pollsele_poll_id='$myrow[0]'";
@$結果 = mysql_query($sql);
echo "
」;
echo ""; 迴聲「」;
echo "」;
echo " >」;
echo "
";
echo "管理";迴聲「」; ?> "; ---------------------------------------------- ---- ------ ------------------------
poll_input.php //新增主題
$ db =mysql_connect( "localhost", "root","391450");
mysql_select_db("class",$db);
$sql="從民意調查中選擇 表格寬度=300高=560 bgcolor=aabbcc 寬度=中心>";
$result=mysql_query($sql); 🎜> {
echo "";echo "";echo $my[ 0];回顯「」; $my[1] ;”;
echo "";echo $my[2];echo "";
則為「
」;
} echo "表>";
? >
if($submit2!="新增")
TION='poll_input.php' METHOD='post'>";
echo "主題:";
echo "";
回中「」; {$db =mysql_connect(" localhost", "root","391450");
mysql_select_db("class",$db);
$sql="select query( $sql);
$sql="插入輪詢值('','$title','')";
mysql_query($sql);
mysql_close();
echo " ";
echo "設定主題:"; 1>";
$db =mysql_connect("localhost", "root","391450");
mysql_select_db("class",$db) ; Poll_Id";
$結果= mysql_query($sql);
mysql_close();
while($myrow=mysql_fetch_row($result))
{ echo "$myrow[0]";}
echo "選擇>」;
echo ""; ";
回顯「」;
回顯「」;
其他
{
{
$db =mysql_connect("localhost", "root","3 91450」);
mysql_select_db("class",$db);
$sql="更新輪詢集Poll_Del='0'";
$結果= mysql_query($sql);
$sql="更新輪詢集合Poll_Del='1' 其中poll_id='$sele'";
$結果= mysql_query($sql);
mysql_close();
echo "" ;
@$result=mysql_query($sql);
{
echo "";echo "";echo $my[0];echo 「";
style= '邊框:1pxsolid rgb(255,255,255)'>$my[1]";
echo "";
echo "」;
則為「
」;
} echo "";
>
";
echo "」;
{ $db =mysql_connect("localhost", " root","391450");
mysql_select_db("class",$db);
if ($submit1=="有效")
'0' where pollsele_id='$sele'";
$result = mysql_query($sql);}
else
{
$sql="update pollsele set Pollsele_Del='1' where🎜> $sql="update pollsele set Pollsele_Del='1' where🎜> $sql="update pollsele set Pollsele_Del='1' 其中 polls polls ='$sele'";
$結果= mysql_query($sql); }
mysql_close();
echo "mysql_query($sql);
$sql="select Poll_Name from poll where poll_id='$poll_id'";
@$ _query($ result);
echo "";
echo $title[0];迴聲「」; "select Pollsele_Name,pollsele_num from pollsele where pollsele_del='0' and pollsele_poll_id='$poll_id'";
@$結果= mysql_query($sql >
while($myrow=mysql_fetch_row($result))
{ echo ""; echo ""; ; |
";echo $myrow[1];迴聲「 |
」;}迴聲「」; }
else
{echo "你不能投空票!!!";}
?>
【論文版權歸作者與奧索網共同擁有,如需轉載,請著作權作者及出處】
以上就介紹了linux伺服器配置與管理投票管理程序,包括了linux伺服器配置與管理方面的內容,希望對PHP教程有興趣的朋友有所幫助。