網頁文章 javax.portlet.title.56

 

<p>
&nbsp;</p>
<form action="show.php" method="post" name="myform">
<p>
學號:<input name="stid" type="text" /></p>
<p>
<input name="key" type="submit" value="送出" /><input name="key" type="reset" value="重設" /></p>
</form>
<p>
&nbsp;</p>
 
網頁文章 javax.portlet.title.56

 

網頁文章 javax.portlet.title.56

 

<?php
$link = mysql_connect("localhost","root","123456") or die("無法連接資料庫");
@mysql_select_db("school")or die("無法選擇資料庫");
mysql_query("SET NAMES 'utf8'");
$sql = "select * from student where sid='$stid'";
$result = mysql_query($sql);
if(mysql_num_rows($result)==0){
echo "找不到資料";
} else {
$row=mysql_fetch_array($result);
echo "<form action=stupdate.php method=post name=myform>";
echo "<p>";
echo "學號:<input name=stid type=text value=$row[sid] readonly></p>";
echo "<p>";
echo "班級:<input name=stclass type=text value=$row[sclass]></p>";
echo "<p>";
echo "姓名:<input name=stname type=text value=$row[sname]></p>";
echo "<input name=key type=submit value=修改 /><input name=key type=reset value=重設 /></p>";
echo "</form>";
}
?>
網頁文章 javax.portlet.title.56

 

網頁文章 javax.portlet.title.56

 

<?php
$link = mysql_connect("localhost","root","123456") or die("無法連接資料庫");
@mysql_select_db("school")or die("無法選擇資料庫");
mysql_query("SET NAMES 'utf8'");
$sql="update student set sclass='$stclass',sname='$stname' where sid='$stid'";
mysql_query($sql) or die ("更新失敗");
header('Location: index.htm');
?>
網頁文章 javax.portlet.title.56