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
Copy binary data from onte table to another
Moderator: General Moderators
-
madan koshti
- Forum Commoner
- Posts: 50
- Joined: Fri Jun 06, 2008 4:25 am
Re: Copy binary data from onte table to another
Hi,
Please mention problem/error in detail!
Any way,why u don't try following way ?
mysql_query("INSERT INTO myNewFiles (fileData, fileType) SELECT fileContent, filType from tab1 WHERE id =\"$id\"");
Please mention problem/error in detail!
Any way,why u don't try following way ?
mysql_query("INSERT INTO myNewFiles (fileData, fileType) SELECT fileContent, filType from tab1 WHERE id =\"$id\"");