The following is the function i am using to take the blob data from one table to another. The problem seem to occur when use the insert:
function insert_cvdoc($custid,$id,$inserttype)
{
//select the database
mysql_select_db(db_name(),db_connect_maker());
//select data from the table
$sql = "select * from cvdump where filedumpid=$id";
$result = @MYSQL_QUERY($sql);
//extract the blob file from the database and the text values
$data = @MYSQL_RESULT($result,0,"dumpfile1");
$type = @MYSQL_RESULT($result,0,"type");
$filename = @MYSQL_RESULT($result,0,"dumpfilename");
//construct the sql statement
$sql = "INSERT INTO cv (cvcustomerNo,cvtype,cvfilename,cvFile) VALUES ('$custid','$type','$filename','$data')";
//process the sql statement
@$result = mysql_query($sql);
$recid= mysql_insert_id();
return $recid;
}