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

From: Date: Mon, 12 Jun 2000 20:32:00 +0000
Subject: Re: Problem recording binarie data in blobs ... i'm becoming real mad
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-1662@lists.php.net to get a copy of this message
I would wonder if there wasn't a single quote in the gif that's making it screw up... maybe change your syntax in your insert? use backslashed double quotes instead of singles? maybe? Ryan On Mon, Jun 12, 2000 at 11:26:51PM +0200, Boaz Yahav wrote: > I'm not sure is the problem is if the upload if failing or something else > but Two things that come to mind in this case : > > 1. The blob you are using is too small and you should switch to LONGBLOB or > MEDIUMBLOB > 2. You have a parameter in MySQL about the max packet size, check out : > > http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=298 > > > This is a long shot cause you are talking about small images... > > berber > http://www.weberdev.com > > -----Original Message----- > From: Arnauld Dravet - smurfie [mailto:smurfie@mankind-guildes.com] > Sent: Monday, June 12, 2000 9:41 PM > To: php-general@lists.php.net > Subject: [PHP-GENERAL] Problem recording binarie data in blobs ... i'm > becoming real mad > > > 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 > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net ---end quoted text---

« previous php.general (#1662) next »