RE: [PHP-GENERAL] Problem recording binarie data in blobs ... i'm becoming real mad
| From: | Boaz Yahav | Date: | Mon, 12 Jun 2000 21:26:51 +0000 |
| Subject: | RE: [PHP-GENERAL] Problem recording binarie data in blobs ... i'm becoming real mad | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-1661@lists.php.net to get a copy of this message | ||
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