如果MYSQL中的Image字段为空或没有上传图像,我如何更新?
我试过了,但没有更新任何内容。
UPDATE `db`.`ts126` SET `Image` = LOAD_FILE('C:'Users'user'Desktop'aa'bb'cc'placeholder.png') WHERE Image=""
我也试过
UPDATE `db`.`ts126`
SET `Image` = 'C:'Users'user'Desktop'aa'bb'cc'placeholder.png'
WHERE Image="" OR Image IS NULL
在这种情况下没有LOAD_FILE,它会更新图像[BLOB - 64 B]
,但当我使用PHP代码显示图像时,不显示任何内容
尝试:
UPDATE `db`.`ts126`
SET `Image` = LOAD_FILE('C:'Users'user'Desktop'aa'bb'cc'placeholder.png')
WHERE Image="" OR Image IS NULL