input.htm
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>input</title>
</head>
<body>
<form method="POST" action="receive.php">
<p>您的姓名: <input type="text" name="T1" size="20"></p>
<p>您的性別:男<input type="radio" value="0" name="R1">
女<input type="radio" name="R1" value="1"></p>
<p>您的EMAIL:<input type="text" name="T2" size="35"></p>
<p>您的留言內容:</p>
<p><textarea rows="16" name="S1" cols="45"></textarea></p>
<p> </p>
<p><input type="submit" value="提交" name="B1">
<input type="reset" value="重置" name="B2"></p>
</form>
</body>
</html>
receive.php
<?php
$user='root';
$password='123';
$db='guestbook';
$table='gbook';
$ip=getenv(REMOTE_ADDR);
$sql = "INSERT INTO `guestbook`.`gbook` (`id`, `name`, `sex`, `email`, `info`, `ip`, `time_at`) VALUES (NULL, '$T1', '$R1', '$T2', '$S1', '$ip', NOW());";
$connect=mysql_connect('localhost',$user,$password);
mysql_select_db($db);
mysql_query($sql);
$result=mysql_query("select * from $table");
while ($arr=mysql_fetch_array($result))
{
if ($arr[2]==0)
$gender='先生';
else
$gender='女士';
?>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Receive</title>
</head>
<body style="background-attachment: fixed">
<table border="1" width="100%" id="table1" bgcolor="#FFFFFF">
<tr>
<td bordercolor="#FFFFFF" bgcolor="#C0C0C0"><?=$arr[6]?>(<?=$arr[5]?>)<p><?=$arr[1]?> <?=$gender?><<a href="<?=$arr[3]?>"><?=$arr[3]?></a>>
寫到:</td>
</tr>
<tr>
<td><?=$arr[4]?><p> </p>
<p><a href="del.php?id=<?=$arr[0]?>">[刪除]</a>
<a href="modify.php?id=<?=$arr[0]?>">[修改]</a>]</td>
</tr>
</table>
</body>
</html>
<?php
echo '<p>';
echo '<p>';
}
?>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建網頁 1</title>
</head>
<body>
<p><a href="input.htm"><繼續留言></a></p>
</body>
</html>
del.php
<?php
$user='root';
$password='123';
$db='guestbook';
$table='gbook';
$sql="DELETE FROM $table WHERE id=$id";
$connect=mysql_connect('localhost',$user,$password);
mysql_select_db($db);
$result=mysql_query($sql);
if ($result)
echo "刪除成功";
else
echo "刪除失敗";
?>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建網頁 1</title>
</head>
<body>
<p><a href="receive.php"><返回首頁></a></p>
</body>
</html>
modify.php
<?php
$user='root';
$password='123';
$db='guestbook';
$table='gbook';
$ip=getenv(REMOTE_ADDR);
$connect=mysql_connect('localhost',$user,$password);
mysql_select_db($db);
$result=mysql_query("select * from $table where id=$id");
$arr=mysql_fetch_array($result);
?>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>input</title>
</head>
<body>
<form method="POST" action="modify_ok.php?id=<?=$id?>">
<p>您的姓名: <input type="text" name="T1" size="20" value="<?=$arr[1]?>"></p>
<p>您的性別:
<?php
if ($arr[2]==0) echo '男<input type="radio" value="0" name="R1" checked>
女<input type="radio" name="R1" value="1"></p>';
else echo '男<input type="radio" value="0" name="R1">
女<input type="radio" name="R1" value="1" checked></p>';
?>
<p>您的EMAIL:<input type="text" name="T2" size="35" value="<?=$arr[3]?>"></p>
<p>您的留言內容:</p>
<p><textarea rows="16" name="S1" cols="45" ><?=$arr[4]?></textarea></p>
<p> </p>
<p><input type="submit" value="修改" name="B1">
<input type="reset" value="重置" name="B2"></p>
</form>
</body>
</html>
modify_ok.php
<?php
$user='root';
$password='123';
$db='guestbook';
$table='gbook';
$connect=mysql_connect('localhost',$user,$password);
mysql_select_db($db);;
$sql = "UPDATE `guestbook`.`gbook` SET `name` = '$T1', `sex` = '$R1', `email` = '$T2', `info` = '$S1' WHERE `gbook`.`id` = '$id' LIMIT 1;";
$result=mysql_query($sql);
if ($result)
echo "修改成功";
else
echo "修改失敗";
?>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建網頁 1</title>
</head>
<body>
<p><a href="input.htm"><繼續留言></a></p>
</body>
</html>
B. 誰有留言板或者表白牆的PHP源碼
您好,很高興為您解答。
【id】這個算是父Id 可以通過這個id來查詢 在這個id下是否有子id 同時也可以記錄這個是那條留言的id
【 son_id】這個是子id 然後通過這個id 可以找到相對應的父id
【 news_id】記錄文章的id
【sender_author】接受留言的人
【receiver_author】發送留言的人
【content】留言的內容
【status】在有人回復你的帖子的時候 這個值從0轉為1時候 該消息不在顯示 如果沒點擊進去 該消息依然存在
【time】記錄留言的時間
留言板回復思路
當發送方(也就留言的人)要到該文章下留言或者回復的的時候就需要接收方(也就文章的作者或者要被回復的人)來接收。單資料庫語句查詢到這個鍵sender_author和receiver_author 的是就會知道接收方是誰和發送方是誰了。然後在根據這個判斷來顯示出回復內容。
提示你有一條新的消息思路
當發送方發送消息的時候 這個status的值默認為0 就是提示接收發 你有一條新的消息。當點擊進去的時候 調用資料庫修改語句把指定的值修改成為1 這樣就不顯示了 。
查看評論的時候 的資料庫操作語句
functionmessage($id){
$query=$this->db->query("SELECT*FROMmessageWHEREnews_id='$id'");//或者文章id後查詢裡面所有評論
return$query->result();
}
這個是獲取父的留言內容的代碼
<?phpforeach($queryas$sel){?>
<p>留言用戶:<?phpecho$sel->receiver_author;?>留言內容:<?phpecho$sel->content?></p>
<?php}?>
用戶是否登陸 並給予留言許可權
<formid="form1"name="form1"method="post"action="<?phpechosite_url()."/publish/user_message"?>">
<textarearows="5"cols="50"name="huifu"<?phpif($uere_name=="0"){echo"disabled";}?>>
<?php
if($uere_name=="0")
{echo"抱歉你還沒登錄不能進行留言";}
?>
</textarea>
<inputclass="wole"name="author"value="<?phpecho$author;?>"/><!--接受方帖子作者-->
<inputclass="wole"name="news_id"value="<?phpecho$news_idx;?>"/><!--文章id-->
<inputtype="submit"name="Submit"/>
</form>
<scriptlanguage="javascript">
functionupdateinfo(){
if(<?phpecho$uere_name;?>==1){
document.form1.Submit.value="留言";
document.form1.Submit.disabled=false;
}
else{
document.form1.Submit.value="還未登錄";
document.form1.Submit.disabled="disabled";
}
}
updateinfo();
</script>
這個是顯示了 獲取指定的父id 之後來顯示他裡面的全部子id 和留言內容
<p>這里是<?phpecho$is;?>樓用戶:<?phpecho$sel->receiver_author;?><br/>留言內容:<?phpecho$sel->content?>
<aonClick="showdiv('contentid<?phpecho$is;?>','showtext<?phpecho$is;?>')"href="javascript:void(0)">回復</a>
<divid="contentid<?phpecho$is;?>"class="none">
<?php
$query=$this->db->query("select*frommessagewhereson_id='$sel->id'orderbyid");//獲取指定父id的子回復
$revis=$query->result();
foreach($revisas$row){?>
<p><?phpif($row->sender_author==$row->receiver_author){echo$row->sender_author;}
else{echo$row->sender_author."回復了:".$row->receiver_author;}?>
內容是:<?phpecho$row->content?></p>
<?php}?>
<formaction="<?phpechosite_url()."/publish/son_message"?>"method="post">
<inputname="son_idx"class="wole"value="<?phpecho$sel->id?>"/>
<inputname="receiver_author"class="wole"value="<?phpecho$sel->receiver_author;?>"/>
<inputclass="wole"name="news_id"value="<?phpecho$news_idx;?>"/><!--文章id-->
<textarearows="5"cols="50"name="huifux"></textarea>
<br><inputtype="submit"name="sub"value="回復"></form></div></p>
<scriptlanguage="JavaScript"type="text/JavaScript">
<!--
functionshowdiv(targetid,objN){
vartarget=document.getElementById(targetid);
varclicktext=document.getElementById(objN)
if(target.style.display=="block"){
target.style.display="none";
clicktext.innerText="回復";
}else{
target.style.display="block";
clicktext.innerText='收起';
}
}
-->
</script>
如若滿意,請點擊右側【採納答案】,如若還有問題,請點擊【追問】
希望我的回答對您有所幫助,望採納!
~ O(∩_∩)O~
C. 求php語言編寫的留言板源碼!!!!!!!!!
這是一個簡單的留言本,目前還沒有後台管理程序。如果哪位高手能補上,那就太好了。
演示在http://www.ideawu.net/person/liuyan
留言保存在message.txt文件中,留言的格式為:date<$>ip<$>name<$>content
"<$>"為分隔符號
注意:源碼文件和message.txt文件必須以gbk格式保存。如果你不知道如何保存文件為gbk格式,請咨詢你的文本編輯器軟體提供商。
/****************************************
* 本代碼可以用作任何用途,但是與作者無關。
* 也就是,你使用本代碼獲取收益或者因此受
* 到損害,後果與作者無關。
****************************************/
file: index.php
代碼:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk">
<title>留言板</title>
<link rel="stylesheet" href="../msg.css" type="text/css">
</head>
<body>
<br><B><FONT COLOR="#0000FF">圖片留言板</FONT></B>
<center>
<table width="800" border="1" bordercolor="#88CCEE" cellspacing="0" cellpadding="4" style="border-collapse:collapse; word-break:break-all">
<tr><td style="border-right-style: none">
<form method="post" action="savemsg.php" style="font-size: 13px">
姓名:<br><input type="text" name="guest_name" maxlength=32 size=32><br>
留言:(字數:<font color="#0000FF"><span id=sNum>0</span></font>/256)<br>
<textarea class="textForm" name="guest_msg" cols="64" rows="8" onkeyup="sNum.innerHTML=this.value.length"></textarea><br>
<input class="button" type="submit" name="submit" value="發表留言">
<input class="button" type="reset" value="重置" name="reset">
</form>
</td></tr>
</table>
<?php
include("showmsg.php");
if(!empty($_GET['p'])){
$num=$_GET['p'];
showpage($num);
}else showpage(1);
?>
</center>
</body>
</html>
file: showmsg.php
代碼:
<?php
function showpage($p)
{ ?>
<table width="800" border="0" bordercolor="#88CCEE" cellspacing="0" cellpadding="4" style="border-collapse:collapse; word-break:break-all;font-size:12px;">
<tr><td>
<p style="line-height: 100%; margin-top: 1; margin-bottom: 1" align="left">
<?php
$perPage=7; //每頁顯示留言數目
$num=$p;
if($num<1) $num=1;
$prev=$num-1;
$next=$num+1;
$page=$num-1; //當前頁碼
$fname="message.txt"; //存儲留言的文件
$all_msg=file($fname); //將留言讀入數組
$line_count=count($all_msg);
$page_count=ceil($line_count/$perPage);
if($prev>0)
echo "<a href=index.php?p=$prev>上一頁</a>";
else
echo "上一頁";
if($line_count>($next-1)*$perPage)
echo "<a href=index.php?p=$next>下一頁</a>";
else
echo "下一頁";
echo "當前第 ".$num." 頁,共有".$page_count."頁,".$line_count."條留言。";
?>
</p></td></tr>
</table>
<table width="800" border="1" bordercolor="#88CCEE" cellpadding="3" cellspacing="0" style="border-collapse:collapse; font-size:12px; word-break:normal; table-layout:fixed;">
<tr height="18" bgcolor="#5FBEF8"><td width="20%">
<b>留言時間/留言者</b></td><td width="86%"><b>留言內容</b>
</td></tr>
<?php
//顯示留言
$bg1="#FBF9F9"; $bg2="#E9EFF4";$bg=$bg2;
for($n=$line_count-1-$page*$perPage;$line_count-1-$page*$perPage-$n<$perPage;$n--){
$bg=($bg==$bg1)? $bg2:$bg1; //變換背景顏色
if(!empty($all_msg[$n])){
list($date,$ip,$name,$msg)=explode("<$>",$all_msg[$n],4); //獲取留言內容
echo "<tr bgcolor=$bg>";
echo "<td width=14%>".$date."<br><b>".$name."</b></td>";
echo "<td width=86%>".$msg."</td>";
echo "</tr>";
}
}
?>
</table>
<table width="800" border="0" bordercolor="#88CCEE" cellspacing="0" cellpadding="4" style="border-collapse:collapse; word-break:break-all;font-size:12px">
<tr><td>
<p style="line-height: 100%; margin-top: 2; margin-bottom: 2" align="left">
<?php
if($prev>0)
echo "<a href=index.php?p=$prev>上一頁</a>";
else
echo "上一頁";
if($line_count>($next-1)*$perPage)
echo "<a href=index.php?p=$next>下一頁</a>";
else
echo "下一頁";
echo "當前第 ".$num." 頁,共有".$page_count."頁,".$line_count."條留言。";
?>
</p></td></tr>
</table>
<?php } ?>
file: savemsg.php
代碼:
<?php
$MSG_MAX_LEN=512; //留言最大長度
if (getenv("HTTP_CLIENT_IP"))
$ip= getenv("HTTP_CLIENT_IP");
elseif (getenv("HTTP_X_FORWARDED_FOR"))
$ip= getenv("HTTP_X_FORWARDED_FOR");
else
$ip= getenv("REMOTE_ADDR");
//獲取IP地址結束
$date=date("Y年m月d日 H:i:s",time());
if(empty($_POST['guest_name']))
die("請填你的名字。<a href=index.php>Refresh</a>");
if(empty($_POST['guest_msg']))
die("請填寫留言內容再提交。<a href=index.php>Refresh</a>");
$guest_name=strip_tags($_POST['guest_name']);
$guest_msg=substr($_POST['guest_msg'],0,$MSG_MAX_LEN);
//write message to file
//make the message be a line when stored
$guest_msg = str_replace( "\r\n", "\n", $guest_msg);
$guest_msg = str_replace( "\r", "\n", $guest_msg);
$guest_msg = str_replace(" "," ",$guest_msg);
$guest_msg = str_replace(">",">",$guest_msg);
$guest_msg = str_replace("<","<",$guest_msg);
$guest_msg = str_replace("\'","'",$guest_msg);
$guest_msg = nl2br($guest_msg);
//保存留言,以追加的形式
$fname="message.txt";
$fp=fopen($fname,"a+");
fwrite($fp,$date."<$>".$ip."<$>".$guest_name."<$>".$guest_msg."\n");
fclose($fp);
echo "<meta http-equiv='refresh' content='0;url=index.php'>";
?>
用於顯示效果的樣式表文件
file: msg.css
代碼:
A:link {
color: #0033FF;
text-decoration: none;
}
A:visited {
color: #0033FF;
text-decoration: none;
}
A:hover {
color: #30A300;
text-decoration: underline;
}
A:active {
color: #0036A9;
text-decoration: none;
}
BODY{
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: 12px;
background: #FBF9F9;
}
TABLE{
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: 12px;
border-collapse: collapse;
table-layout: fixed;
margin: 0px;
}
D. 求php留言板代碼,就是按提交後直接顯示在頁面的,在留言,再增加一條
[M][ftc=#EE1000][fts=6][ftf=Webdings]Y[/ft][/ft][/ft]
[ftc=#00BFF3]﹌﹌﹌﹌﹌﹌﹌﹌﹌﹌﹌﹌﹌﹌﹌﹌﹌﹌﹌﹌﹌﹌﹌﹌﹌[/ft]
[ftc=#FFF100]對
自
己
好
點,
因
為
一
輩
子
不
長;[/ft]
[ffg,#F68E54,#FFFFFF]對
身
邊
的
人
好
點,因
為
下
輩
子
不
一
定
能
夠
遇
見。[/ft]
[ftc=#00BFF3]——————————————————————————
[ftc=#EE1D24]◣[/ft][ftc=#FFF100]◤[/ft]
[ftc=#37B400]◢[/ft][ftc=#00AEEF]◥[/ft][/M][M][/M][M][/M][M][/M][M][/M][M][/M]
[M][ftc=000000][/ft][/M][/ft][/ft][/ft][/ft][/ft][/ft][/ft][/ft][/ft][/ft][/M][/M][/M][/M][/M][/M][/M][/M][/M][/M][/M][/M][/M]
E. 解釋分析PHP留言板代碼 急!好的 詳細的加高分!
呼呼,給你幾乎每一句都注釋了
<form action="#" method="post"
enctype="multipart/form-data">
name<input name=name >sex<input name=sex >age<input name=age >QQ<input name=qq >
<label for="file">Filename:</label>
<input type="file" name="file" id="file" />
<br />
<input type="submit" name="submit" value="Submit" />
</form>
<!--以上為留言板的留言表單-->
<?php
$host="localhost";
$user="root";
$password="";
$db="testdb";
$con=@mysql_connect($host,$user,$password); //不報錯創建與mysql資料庫伺服器的連接
if(!mysql_select_db($db)){ //選擇伺服器資料庫
echo "沒有相應資料庫,正在給你創鍵"; //如果資料庫不存在
mysql_query("CREATE DATABASE `testdb` DEFAULT CHARACTER SET gb2312 COLLATE gb2312_chinese_ci;"); //創建一個名為textdb的資料庫,使用gb2312字元集
mysql_query("CREATE TABLE `testdb`.`book` ( //一下為在textdb下創建book數據表
`name` VARCHAR( 20 ) NOT NULL , //表列name,為20字元以內的非空字元串
`sex` VARCHAR( 3 ) NOT NULL , //表列sex,為3字元以內的非空字元串
`age` INT( 3 ) NOT NULL , //表列age,為3位以內的整數
`time` VARCHAR( 20 ) NOT NULL , //表列time,為20字元以內的非空字元串
`qq` VARCHAR( 15 ) NOT NULL , //表列qq,為15字元以內的非空字元串
`url` VARCHAR( 30 ) NOT NULL , //表列url,為30字元以內的非空字元串
PRIMARY KEY ( `name` ) //創建關鍵索引name
) ENGINE = MYISAM;"); //使用MYISAM資料庫系統
echo "成功創建!";
}
if(!file_exists("up")) //如果up文件夾不存在
{
mkdir("up",0777); //創建文件夾up,為全體可讀寫執行
@chmod("up",0777); //不報錯改變文件夾up為全體可讀寫執行
}
$name=split("\.",$_FILES["file"]["name"]); //用「.」分割上傳的文件名字,返回一個數組
$counter=count($name)-1; //給$counter賦值$name數組的個數減一
$pre=$name[count($name)-1]; //給$pre賦值$name數組的最後一位(也就是文件擴展名,不含「.」)
$dastr=date("YmdHis"); //給$dastr賦值當前時間(格式為:年月日時分秒)
if (file_exists("up/" . $_FILES["file"]["name"])) //如果up文件夾中有與上傳的文件重名的文件
{
echo $_FILES["file"]["name"] . " already exists. "; //輸出文件已存在
}
else //否則
{
move_uploaded_file($_FILES["file"]["tmp_name"],
"up/" . $dastr.'.'.$pre); //將上傳的文件從臨時緩存移動到up文件夾當中並改名為「日期.擴展名」
}
$name=$_POST['name']; //給$name賦值為表單中name輸入框的內容
$age=$_POST['age']; //給$age賦值為表單中age輸入框的內容
$sex=$_POST['sex']; //給$sex賦值為表單中sex輸入框的內容
$qq=$_POST['qq']; //給$qq賦值為表單中qq輸入框的內容
$url="up/" . $dastr.'.'.$pre; //給$url賦值為上傳文件的地址
$time=date("Y-m-d H:i:s"); //給$time賦值為當前時間(格式:年-月-日 時:分:秒)
mysql_query("set names gb2312"); //設置字元集,解決中文亂碼問題
mysql_select_db($db); //選擇資料庫
$exec="insert into book (name,age,sex,qq,time,url) values ('$name','$age','$sex','$qq','$time','$url')";
//給$exec賦值向book表中添加數據的命令字元串
if($name!=''){ //如果$name不是空
$result=mysql_query($exec); //執行$exec的命令
}
$sql="select * from book"; //給$sql賦值選取book當中的所有列和行的命令的字元串
$result=mysql_query($sql); //執行$sql語句,返回結果
while($rs=mysql_fetch_object($result)) //遍歷所有結果(循環直到所有$result當中的結果都以輸出)
{
echo "<div class=result><ul><li>用戶名:".$rs->name."</li>\n"; //一下為輸出留言內容
echo "<li>年領:".$rs->age."</li>\n";
echo "<li>年領:".$rs->sex."</li>\n";
echo "<li>QQ:".$rs->qq."</li>\n";
echo "<li>頭像: <img src=".$rs->url." /></li>\n";
echo "<li>留言時間:".$rs->time."</li></ul></div>\n";
}
mysql_close(); //關閉與數據服務間的連接
?>
F. 關於php簡易留言板的一小段代碼..
我先給每行程序加上注釋
<?php
$name=$_POST['name'];//獲取表單提交過來的數據
$note=$_POST['note'];//同上
$db=new mysqli('localhost','root','123','dlw');//連接mysql資料庫並選擇dlw資料庫,很老的寫法了,不建議這么使用。
$sql="insert into gustbook values(name,time,words)";//sql語句
$sql=$sql.$name;//等同於sql .= $name 相當於讓上面那條sql語句後面連接$name但是這里在$name前面漏掉了一個( 應該是$sql = $sql."(".$name
$sql=$sql."',now(),'".$note."')";//同上
$result=$db->query($sql);//執行sql語句
echo"<center>write successfully.</center><br><br>";//輸出write successfully字元串,沒有任何意義,因為不管執行成不成功他都輸出。
?>
<html>
<body bgcolor="FFCCCC">
<center>
<a href="do.php">write again</a><br><br>
<a href="index.php">check out the message</a>
</center>
</body>
</html>
這應該是個很老的程序,你要用首先要改正幾個地方的寫法
1、$db=new mysqli('localhost','root','123','dlw');
最好寫成
mysql_connect('localhost','root','123');
mysql_slect_db('dlw');
2、 $sql="insert into gustbook values(name,time,words)";
$sql=$sql.$name;
$sql=$sql."',now(),'".$note."')";
可以寫一個sql語句就可以了,不用去連接,而且最好用標準的寫法。
$sql = "insert into gustbook (name,time,words) values ('".$name."',now(),'".$note."')";
3.$result=$db->query($sql);
echo"<center>write successfully.</center><br><br>";
加一個寫入成功的判斷
if(mysql_query($sql)){//注意這里不是$db因為我們前面把mysqli這個類已經省掉了。
echo"<center>write successfully.</center><br><br>";
}else{
"<center>write false.</center><br><br>";
}
具體留言不成功,可能還有幾個問題,首先你的資料庫有沒有這幾個欄位,還有具體有沒有連接成功資料庫,你可以用phpmyadmin看一看你的留言內容是不是已經寫入資料庫,如果有但沒顯示,那應該是讀取時候的問題,就不是你這個程序的問題了。
你用我給說的寫法試一下也不行嗎。
mysql_slect_db('dlw');
你確定資料庫連接成功了嗎,
把mysql_connect('localhost','root','123');改為
mysql_connect('localhost','root','123') or die("資料庫連接不成功");
如果數據沒有進去,那就跟index.php沒有任何關系,我看一下你現在的這個程序。表單還有添加的程序,還有數據表的結構。