Problem recording binarie data in blobs ... i'm becoming real mad

From: Date: Mon, 12 Jun 2000 19:41:15 +0000
Subject: Problem recording binarie data in blobs ... i'm becoming real mad
Groups: php.general 
Request: Send a blank email to php-general+get-1655@lists.php.net to get a copy of this message
Hi, I'm trying to setup a little page where users can enter different informations about them, and upload a little picture. everything, including the picture, *should* be stored in the database. The upload works fine, the problem is when i record the binary data of the pic in the blob field ... if it's a GIF it only records GIF89a@ it's useless to say there should be something else after GIF89a@ ... here is my code for storing the data: <?php if ($Logo_choix=="personnel") { if ($Logo!="none") { $taille = GetImageSize($Logo); $final["width"] = $taille[0]; $final["height"] = $taille[1]; $type = substr($Logo_name, strrpos($Logo_name, ".")+1); switch (strtoupper($type)) { case "JPEG": $final["format"] = "jpeg"; break; case "JPG": $final["format"] = "jpeg"; break; case "GIF": $final["format"] = "gif"; break; } $final["raw"] = addslashes(fread(fopen($Logo, "r"), filesize($Logo))); $resultat_requete = mysql_query("insert into Logo_Temp (numero, width, height, format, raw) values (NULL, '$final[width]', '$final[height]', '$final[format]', '$final[raw]')"); $id_logo=mysql_insert_id(); } } ?> i found and modified the code on phpbuilder.com and in the phpAds script .... i'm really becoming mad, i've spent several hours on that problem .... thanks if anyone can help ... Arnauld Dravet smurfie@mankind-guildes.com

« previous php.general (#1655) next »