views:

23

answers:

2

Right I seem to be having a issue inserting a image into a database (don't ask why lol)

If tryed a simple

UPDATE player SET Image = load_file('94.jpg') WHERE id =94;

And had the image directly located from where im running the sql commands from

UPDATE player
SET Image = load_file('C:\Users\***\Documents\databases\Scripts\94.jpg') WHERE id =94;

I have also tried the above with the full path but when i query the table it shows the Image column of type LargeBlog as empty!

Any ideas????

A: 

The file must be on the machine MySQL is installed on.

MindStalker
A: 

I have managed to fix it with the use of forward slashes instead of back slashes. So im getting it into the database now... all goood

but i want to do relative paths and as i said ('94.jpg') doesn't work. When its placed my C:\Wamp directory... Which is the same place I put sql scripts when I run them with a simple

source script.sql; <-Notice no path required and it works. So I assumed that MySql default directory was the Wamp Folder

Steve
Source pulled relative from the client, load_file pulls relative to the server, possibly mysqld.exe it depends upon your .cnf
MindStalker