Welcome Guest, Not a member yet? Register   Sign In
uploading an image (BLOB) to mysql
#3

(This post was last modified: 03-20-2021, 11:20 AM by richb201.)

(03-19-2021, 11:26 AM)InsiteFX Wrote: MySQL BLOB using PHP
Thanks. 

I am now able to convert the .png into a string. But when i try to insert it into the table I am getting:
ERROR - 2021-03-20 09:42:07 --> Query error: Invalid utf8 character string: '\x89PNG' - Invalid query: INSERT INTO word.image_BLOB VALUES(�PNG

The actual code is:

      $sql = "INSERT INTO $_SESSION[table].image_BLOB VALUES($imgData)";

      $iRc=$this->db->query($sql);


I also tried
$sql = "INSERT INTO $_SESSION[table].image_BLOB VALUES({$imgData})";

But with the same result. Any ideas of what to do?

It seems to insert but I really can't tell if it is getting placed correctly into the table since I am a neophyte with sqlWorkbench.
proof that an old dog can learn new tricks
Reply


Messages In This Thread
uploading an image (BLOB) to mysql - by richb201 - 03-19-2021, 09:04 AM
RE: uploading an image (BLOB) to mysql - by richb201 - 03-20-2021, 12:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB