If $filedata is a file on your filesystem -> 'c:\\images\\item_1.jpg' then
there appears to be no need to do anything. MySQL will load the data as-is.
If you 'read' $filedata into a variable first via fopen,fread,fclose then it
seems that you must either base64 or addslashes it before MySQL will except
it. In this case:
$data = '';
$fp = fopen($filedata,'r');
while (!feof($fp))
{
$data .= fread($fp,1024);
}
fclose($fp);
$slashed_data = addslashes($data);
UPDATE table_name SET filesize = $filesize, data = '$slashed_data' WHERE id
= 1
---
notice no LOAD_FILE, and quotes around the variable...
Norman
--
Avatar hosting at
www.easyavatar.com
"Frank Natoli" <fr*********@worldnet.att.net.nospam> wrote in message
news:KV*****************@newsread2.news.atl.earthl ink.net...
Thanks. Will this work if the data in $filedata is binary? Or must I
base64 the data first?
"Norman Peelman" <np******@cfl.rr.com> wrote in message
news:AN*******************@tornado.tampabay.rr.com ...
"Frank Natoli" <fr****@nospam.com> wrote in message
news:eR*****************@newsread3.news.atl.earthl ink.net... Having created a table with a longblob column, what is the insert syntax
to set the value of the longblob column? The data will be read from a file.
example:
UPDATE table_name SET filesize = $filesize, data = LOAD_FILE('$filedata')
WHERE id = 1
where $filedata is equal to 'drive:/path/to/your/file'
Norman
--
Avatar hosting at www.easyavatar.com