投票管理程序
表结构
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))
- ------------------------------------- --------------------
설문조사 .php //主程序
$db =mysql_connect("localhost", "루트","391450");
mysql_select_db("class",$db);
$sql="poll_del='1'인 설문에서 poll_id,Poll_Name을 선택하세요.";
@$result = mysql_query($sql);
$myrow=mysql_fetch_row($result);
echo "<테이블 정렬=중앙 bgcolor=aabbcc 너비=250 높이=450 테두리=0>";
echo "
"; echo "$myrow[1]"; $sql="pollsele_del='0' 및 pollsele_poll_id='$myrow[0]'"인 pollsele에서 Pollsele_Name,pollsele_poll_id를 선택합니다."; @$result = mysql_query($sql); echo ""; 에코 " | ";
에코 "";
mysql_close();
에코 "
";
echo "
";
echo "관리"; echo "
"; ?>
---------------------------------- -----------
poll_input.php //添加主题
$db =mysql_connect("localhost", "루트","391450");
mysql_select_db("class",$db);
$sql="설문조사에서 poll_id,poll_name,poll_del 선택";
echo "<테이블 너비=300 높이=560 bgcolor=aabbcc align=center>";
$result=mysql_query($sql);
while($my=mysql_fetch_row($result))
{
echo "
";echo "";echo $my[ 0];에코 " | ";
echo "$my[1] | echo "";echo $my[2];echo " | ";
에코 "
";
} echo "테이블>";
?>
<머리>
if($submit2!="添加")
{ echo "
";
echo "
"; }
else
{$db =mysql_connect("localhost", "root","391450");
mysql_select_db("class",$db);
$sql="poll_name='$title'인 설문조사에서 poll_name을 선택하세요.";
mysql_query($sql);
$sql="설문 값에 삽입('','$title','')";
mysql_query($sql);
mysql_close();
echo "
";
echo "
设置主题:";
echo "<이름 선택='선택' 크기=1>";
$db =mysql_connect("localhost", "root","391450");
mysql_select_db("class",$db);
$sql="설문조사에서 Poll_Id 선택";
$result = mysql_query($sql);
mysql_close();
while($myrow=mysql_fetch_row($result))
{ echo "