插入Blob内容到另一个Blob (MySQL)


Inserting Blob Content into another Blob (MySQL)

while($get_orange = mysql_fetch_assoc($select_image)){
$orange = $get_orange['image'];
$insert_test = mysql_query("INSERT INTO `image_test` (`id`,`image`) VALUES ('','".$orange."'");
}

我该怎么做呢?变量橙色是blob内容,我试图将这个blob内容插入到另一个表的另一个blob中。如果这是可能的,我该怎么做?我需要这个为我的网站的许多功能。

您可以通过一个查询来实现这一点,该查询将从一个表中选择和插入到另一个表中:

INSERT INTO `image_test` (`id`, `image`) SELECT '', `image` FROM `images`;

你没有显示你原来的SELECT查询,所以我猜一点。上面的查询将把image中的所有行插入到image_test中。您可以根据需要添加WHERE条件