开发者

Insert LargeBlog sql issue

开发者 https://www.devze.com 2022-12-21 02:25 出处:网络
Right I seem to be having a issue inserting a image into a database (don\'t ask w开发者_如何学JAVAhy lol)

Right I seem to be having a issue inserting a image into a database (don't ask w开发者_如何学JAVAhy 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????


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消