简体   繁体   English

如果MYSQL [BLOB]为NULL,如何更新

[英]How can i update if MYSQL [BLOB] is NULL

How can i update if Image field in MYSQL is empty or no image is uploaded? 如果MYSQL中的图片字段为空或没有上传图片,如何更新?

I tried this but doesnt update anything. 我试过了,但没有更新任何东西。

     UPDATE `db`.`ts126` SET `Image` = LOAD_FILE('C:\Users\user\Desktop\aa\bb\cc\placeholder.png') WHERE Image="" 

Also i tried 我也尝试过

    UPDATE `db`.`ts126`
   SET `Image` = 'C:\Users\user\Desktop\aa\bb\cc\placeholder.png'
 WHERE Image="" OR Image IS NULL

Which is without LOAD_FILE in this case it updates the images [BLOB - 64 B] but When i display the image using PHP code Nothing shows up 在这种情况下没有LOAD_FILE会更新图像[BLOB - 64 B]但是当我使用PHP代码显示图像时,什么都没有显示

Try: 尝试:

UPDATE `db`.`ts126`
  SET `Image` = LOAD_FILE('C:\Users\user\Desktop\aa\bb\cc\placeholder.png')
WHERE Image="" OR Image IS NULL

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM