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