<?php
include ("connect.php");
$id=@addslashes($_GET['id']);
$image=@mysql_query("select * from tipuranibasti where id = $id");
$image_row=@mysql_fetch_assoc($image);
$name=@$image_row['name'];
$date=@$image_row['date'];
$msg=@$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";
}
?>
1 我能够将所有数据从 tipuranibasti 移动到 puranibasti 表,除了图像任何人都可以帮忙
最佳答案
也许你可以在单个sql语句中插入值而不是选择+插入:
if(
@mysql_query("
insert into puranibasti
select '', name, date, msg, image
from tipuranibasti where id = $id"
")
关于php - 如何将图像数据从一张表移动到另一张表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8631758/