[請益] 篩選後的資料怎麼寫入另一個資料表@@?
請問~我現在比方說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
12/02 13:47, 1F
推
12/03 01:32, , 2F
12/03 01:32, 2F
推
12/03 03:23, , 3F
12/03 03:23, 3F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章