看板 PHP 關於我們 聯絡資訊
請問~我現在比方說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
johnney:insert ... select 找 mysql 的文件關於這部分~~ 12/02 13:47
appleboy46:資料庫 4大語法 Select Insert Update Delete請搞懂 12/03 01:32
cyvsswc:try出來了~謝謝一樓:) 12/03 03:23