0
如何從一個表中複製一行:'tipuranibasti'(一列是圖像的blob類型)到另一個表:'puranibasti'。用我的代碼,除了blob字段[image field]外,所有字段都被複制到puranibasti。如何將一行從一個表複製到另一個表
blob字段在數據庫中的puranibasti表中看起來像[BLOB - 0B]。
<?php
include ("connect.php");
[email protected]($_GET['id']);
[email protected]_query("select * from tipuranibasti where id = $id");
[email protected]_fetch_assoc($image);
[email protected]$image_row['name'];
[email protected]$image_row['date'];
[email protected]$image_row['msg'];
$image=addslashes(@file_get_contents($image_row['image']));
if(@mysql_query("insert into puranibasti values('','$name','$date','$msg','$image')"))
{
echo "image has been inserted successfully";
} else
{
echo "problem inserting the image";
}
?>
謝謝你的回覆...我用另一個查詢作品:: insert into puranibasti select'',name,date,msg,image from tipuranibasti where id = $ id – tabi 2011-12-26 15:48:24