UPDATE or INSERT Pictures in MySQL
Posted: Sun Dec 17, 2006 12:25 pm
Holá everybody,
Trying to save a picture (.jpg or .bmp) to mySQL Database.
After understanding INSERT, DELETE and, with a lot of help (thanks Mark) also UPDATE, I want to UPDATE also my Pictures. Thinking, it's the same way than a text, but I'm wrong
Reading everything I found in the www, I found out, that I have to sent a "*b" in front of the image. Well but this also does not work. Here is the stack:
I Use
put the imagedata of image "Foto_Image" into temp3
put "UPDATE knddaten SET Foto_image =*b" & temp3 & " WHERE kndnr =" & kundennummer into SQL_Befehl
revexecuteSQL rec_ID, SQL_Befehl
In the Variable Watcher I can see the SQL_Befehl as:
UPDATE knddaten SET Foto_image = ' --- here are crazy signs -- ' where kndnr = 3120 ## which looks ok
The Error Message shown by the Message box is:
You have an error in your SQL Syntax; check the manual that corresponds to your mySQL server version for the right syntax to use near ' ## the crazy signs, but not so much as there are in the picture
The problem seems to be, that the image itself will not be transfered.
The type of Table Customers and Field Foto_image is set to BLOB
Again, I need a helpfull hand
best regards and thank you
Horst
Trying to save a picture (.jpg or .bmp) to mySQL Database.
After understanding INSERT, DELETE and, with a lot of help (thanks Mark) also UPDATE, I want to UPDATE also my Pictures. Thinking, it's the same way than a text, but I'm wrong
Reading everything I found in the www, I found out, that I have to sent a "*b" in front of the image. Well but this also does not work. Here is the stack:
I Use
put the imagedata of image "Foto_Image" into temp3
put "UPDATE knddaten SET Foto_image =*b" & temp3 & " WHERE kndnr =" & kundennummer into SQL_Befehl
revexecuteSQL rec_ID, SQL_Befehl
In the Variable Watcher I can see the SQL_Befehl as:
UPDATE knddaten SET Foto_image = ' --- here are crazy signs -- ' where kndnr = 3120 ## which looks ok
The Error Message shown by the Message box is:
You have an error in your SQL Syntax; check the manual that corresponds to your mySQL server version for the right syntax to use near ' ## the crazy signs, but not so much as there are in the picture
The problem seems to be, that the image itself will not be transfered.
The type of Table Customers and Field Foto_image is set to BLOB
Again, I need a helpfull hand
best regards and thank you
Horst