頁: [1]
|
 |
|
作者
|
主題: 求救!!! (閱讀 824 次)
|
我也很想他

離線
文章: 27
|
 |
求救!!!
« 於: 2005-04-30, 22:47:28 » |
|
<html> <head> <title>查詢</title> <meta http-equiv="Content-Type" content="text/html; charset=big5"> </head> <table> <body> <h2 align="center">查詢資料</h2> <font color="red">請輸入欲查詢資料</font>
<form action="update1.php" method="POST"> E_code:<input type="text" name="E_code"> <input type="submit" value="查詢"> </form>
<?php $E_code=$_POST['E_code']; $E_name=$_POST['E_name']; $E_sex=$_POST['E_sex']; $E_age=$_POST['E_age']; $E_birthday=$_POST['E_birthday']; $E_address=$_POST['E_address']; $E_business=$_POST['E_business']; if(isset($E_code)){ $link=mysql_connect("localhost","root",""); mysql_select_db("Hospital"); mysql_query("set character set big5"); $check=mysql_query("select * from employee where E_code='$E_code'"); $sum=mysql_num_rows($check); if($sum==0){ echo "sorry,查詢不到你要修改的資料!!"; exit; ?> <?php }else{ $str="update employee set E_name='$E_name',E_sex='$E_sex',E_age='$E_age',E_birthday='$E_birthday',E_address='$E_address',E_business='$E_business' where E_code='$E_code'"; //echo $str; mysql_query($str); ?> <?php $result=mysql_query("select * from employee where E_code='$E_code'"); while(list($E_no,$E_code,$E_name,$E_sex,$E_age,$E_birthday,$E_address,$E_business)=mysql_fetch_row($result)) { ?> <hr> <h2 align="center"> 修改資料區 </h2> <font color="red">修改--在下面欄位輸入要修改的資料 </font>
<form action="update1.php" method="POST"> /*<p>"E_code:".$E_code</p>;*/ <p>"E_name:"<input type="text" name="E_name" value="$_POST['E_name']"></p> <p>"E_sex:"<input type="text" name="E_sex" value="$E_sex"></p> <p>"E_age:"<input type="text" name="E_age" value="$E_age"></p> <p>"E_birthday:"<input type="text" name="E_birthday" value="$E_birthday"></p> <p>"E_address:"<input type="text" name="E_address" value="$E_address"></p> <p>"E_business:"<input type="text" name="E_business" value="$E_business"></p> <?php } ?> <p><input type="submit" name="submit" value="更新"> </form> <?php }mysql_close($link); } ?> </table> </body> </html> ======================================= 好心人幫幫我~~為什麼我的資料出現不了在欄位上呢?一直出不來
 糾察與勸告: 發表文章請使用"明確"主題
|
|
|
|
« 最後編輯時間: 2005-05-01, 00:30:21 由 小誌 »
|
已記錄
|
|
|
|
|
|
我也很想他

離線
文章: 27
|
 |
Re: 求救!!!
« 回覆文章 #2 於: 2005-05-01, 01:16:17 » |
|
不好意思喔~
貼的時候沒有注意~
下次我會注意一下~
sorry~
|
|
|
|
|
已記錄
|
|
|
|
頁: [1]
|
|
|
|
|