a bunch of things:

1) when you read the image you need to use "rb" mode since it's
binary data
2) addslashes() isn't good enough. try mysql_escape_string instead.
3) the way you're doing it the handle to the image file never gets
fclosed(), I don't know if that's really a problem tho
4) if your image is too big it won't fit in a blob so you might want
to upgrade to a mediumblob

On Wed, 21 Nov 2001 17:24:42 -0200, Rodrigo Peres wrote:
>I have a table in mysql that stores some images my fields in this
>table are:
>ImageID,Image_Name, Image_Size, Image_Type, Image_Data (this is the
>The problem is, when i insert a new image everything goes fine, but
>I can't
>update it!!! Why?
>to insert I'm using this
>if($image != "none") {
>  $image_bd =
>  $sql = "INSERT INTO

>and to update:
>if($imagem != 'none') {
> $Image_bd =
>  $sql = "UPDATE imagens SET

>',Image_Data='$image_bd' WHERE ImageID='$ImageID'";
>Why I cant' update??
>Thank's in advance

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to