Copy binary data from onte table to another
Posted: Fri Oct 03, 2008 8:09 pm
Hello
I want to take binary data from one table and insert it to another but I get sql error dooing this and I can't figure out why. I try to do like this:
$dbQuery = sprintf("SELECT fileContent, filType FROM myFiles WHERE id = $id");
$result = mysql_query($dbQuery) or die("Couldn't get file list");
while ($row = mysql_fetch_assoc($result)) {
$fileContent = $row['fileContent'];
$fileType = $row['fileType'];
}
mysql_query("INSERT INTO myNewFiles (fileData, fileType) VALUES('$fileContent', '$fileType') ")
or die(mysql_error());
Can anyone help me, please...
Regards
I want to take binary data from one table and insert it to another but I get sql error dooing this and I can't figure out why. I try to do like this:
$dbQuery = sprintf("SELECT fileContent, filType FROM myFiles WHERE id = $id");
$result = mysql_query($dbQuery) or die("Couldn't get file list");
while ($row = mysql_fetch_assoc($result)) {
$fileContent = $row['fileContent'];
$fileType = $row['fileType'];
}
mysql_query("INSERT INTO myNewFiles (fileData, fileType) VALUES('$fileContent', '$fileType') ")
or die(mysql_error());
Can anyone help me, please...
Regards