[請益] 篩選後的資料怎麼寫入另一個資料表@@?

看板PHP作者 (台北米)時間19年前 (2005/12/02 12:26), 編輯推噓3(300)
留言3則, 3人參與, 最新討論串1/1
請問~我現在比方說mysql裡面.. 從work資料庫裡面..一個叫new的資料表裡面.. 篩選出資料..現在篩選出來後..我想把篩選出來的資料放進叫做try的資料表.. 我看書上後..我只知道.. $str="insert into try (title,year,x,xxx,xxx,xx) values ()"; 可是我不知道values裡面要怎麼填@@".. 麻煩前輩指教一下>"<..又或者這個方法也錯= =".. 那個try空的資料表我有先建好了.. 然後我其他部份程式碼如下.. $result = mysql_query("SELECT * FROM new WHERE flows>=3000"); $rows=mysql_num_rows($result); $cols=mysql_num_fields($result); echo "<table border=1>"; echo "<tr>"; for ($i=0; $i<$cols; $i++){ echo "<th>",htmlentities(mysql_field_name($result,$i)),"</th>"; } while($row=mysql_fetch_row($result)){ echo "<tr>"; for($i=0;$i<$cols;$i++){ echo "<td>",htmlentities($row[$i]),"</td>"; } echo "</tr>\n"; } echo "</table>"; -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 210.85.36.57

12/02 13:47, , 1F
insert ... select 找 mysql 的文件關於這部分~~
12/02 13:47, 1F

12/03 01:32, , 2F
資料庫 4大語法 Select Insert Update Delete請搞懂
12/03 01:32, 2F

12/03 03:23, , 3F
try出來了~謝謝一樓:)
12/03 03:23, 3F
文章代碼(AID): #13Zyq3XV (PHP)
文章代碼(AID): #13Zyq3XV (PHP)