Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

update blob with a url

Status
Not open for further replies.

LuckySyringe

Technical User
Oct 11, 2005
35
0
0
US
I'm using PHP to run a loop of MySQL queries that should update the blobs with small image files, but it doesn't work. I am thinking its because I am running the queries remotely, because the MySQL documentation seems to only upload the files locally, is there any difference?
$fileURL is in the form
Code:
[URL unfurl="true"]http://www.host.com/image(x).gif[/URL]
where (x) is 1 - 395 (without parenthesis).

Code:
UPDATE $dbTable SET content=LOAD_FILE('$fileURL') WHERE id=$x

-> LuckySyringe
 
The LOAD_FILE path is interpreted at the server, so it must be a path accessible from the server.

Your best solution would be to include the binary data in the query, escaping it appropriately. That's exactly what the mysqldump program does. There might be functions in the PHP database API which are designed for that.
 
Ok, I will look through the functions in the PHP/MySQL APIs

-> LuckySyringe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top