[請益] 如何將MySql資料放入Form裡面呢?
我做了一個簡單的FORM,可以寫入至資料庫
類似這樣:
echo "<form method='POST'>";
echo
"<table border=1>
<tr>
<td><input name='name1' type='text'></td>
<td><input name='name2' type='text'></td>
</tr>
<tr>
<td><input name='name3' type='text'></td>
<td><input name='name4' type='text'></td>
</tr>
</table>";
echo "<input type=submit name='abc' value='存檔'>";
echo "</form>";
已經完成將表單裡的資料寫入mysql
目前想要在使用者重新整理網頁,或開啟網頁時
網頁直接讀取資料庫裡的資料,並放在input裡面呢?
想加個讀取按鈕,並放在可輸入資料的欄位裡
麻煩各位大大幫我解答><
我已經解決了...
因為程式寫在*.php檔,要用網頁呈現
所以才會用echo方式
我是用這種方式解決的
mysql_select_db("mysql_db", $con);
$result1 = mysql_query("select * from user");
$row1 = mysql_fetch_array($result1);
.
.
.
echo "<td><input name='name1' type='text' value='".$row1['name1']."'></td>";
.
.
.
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.121.26.61
推
02/09 13:50, , 1F
02/09 13:50, 1F
→
02/09 13:59, , 2F
02/09 13:59, 2F
推
02/09 14:35, , 3F
02/09 14:35, 3F
→
02/09 14:36, , 4F
02/09 14:36, 4F
※ 編輯: hiasdasz 來自: 122.121.26.61 (02/09 16:36)
※ 編輯: hiasdasz 來自: 122.121.26.61 (02/09 16:40)
→
02/09 16:39, , 5F
02/09 16:39, 5F
推
02/09 17:20, , 6F
02/09 17:20, 6F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章
4
11