dESIGN
09-04-2002, 12:30
hi,
ich habe folgendes problem. Intalliert habe ich php4.06 und MySQL 3.23.37 ... nun moechte ich images in die datenbank packen, das funktioniert auc hsoweit gut.. nur anstelle der binary_data steht dort immer nur [blob] .. woran liegt das ? muss was spezielles in mysql oder php aktiviert sein? tmp-dir etc ist alles vorhanden.
Danke schon mal fuer die hilfe.
achja.. hier ist der source von dem script.. vielleicht liegt er fehler ja dort.
tabelle sieht so aus:
------------------------------------------
CREATE TABLE binary_data (
id INT(4) NOT NULL AUTO_INCREMENT PRIMARY KEY,
description CHAR(50),
bin_data LONGBLOB,
filename CHAR(50),
filesize CHAR(50),
filetype CHAR(50)
);
------------------------------------------
<?php
include "inc.php";
if ($submit) {
mysql_select_db("$db2");
$data = addslashes(fread(fopen($form_data, "r"), filesize($form_data)));
$result=MYSQL_QUERY("INSERT INTO binary_data (description,bin_data,filename,filesize,filetype) ".
"VALUES ('$form_description','$data','$form_data_name','$form_data_size','$form_data_type')");
$id= mysql_insert_id();
print "<p>This file has the following Database ID: <b>$id</b><br>";
print "server path for showing the images inside you document is: get.php?id=$id";
MYSQL_CLOSE();
} else {
// else show the form to submit new data:
?>
<form method="post" action="<?php echo $PHP_SELF; ?>" enctype="multipart/form-data">
File Description:<br>
<input type="text" name="form_description" size="40">
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000000">
<br>File to upload/store in database:<br>
<input type="file" name="form_data" size="40">
<p><input type="submit" name="submit" value="submit">
</form>
<?php
}
?>
ich habe folgendes problem. Intalliert habe ich php4.06 und MySQL 3.23.37 ... nun moechte ich images in die datenbank packen, das funktioniert auc hsoweit gut.. nur anstelle der binary_data steht dort immer nur [blob] .. woran liegt das ? muss was spezielles in mysql oder php aktiviert sein? tmp-dir etc ist alles vorhanden.
Danke schon mal fuer die hilfe.
achja.. hier ist der source von dem script.. vielleicht liegt er fehler ja dort.
tabelle sieht so aus:
------------------------------------------
CREATE TABLE binary_data (
id INT(4) NOT NULL AUTO_INCREMENT PRIMARY KEY,
description CHAR(50),
bin_data LONGBLOB,
filename CHAR(50),
filesize CHAR(50),
filetype CHAR(50)
);
------------------------------------------
<?php
include "inc.php";
if ($submit) {
mysql_select_db("$db2");
$data = addslashes(fread(fopen($form_data, "r"), filesize($form_data)));
$result=MYSQL_QUERY("INSERT INTO binary_data (description,bin_data,filename,filesize,filetype) ".
"VALUES ('$form_description','$data','$form_data_name','$form_data_size','$form_data_type')");
$id= mysql_insert_id();
print "<p>This file has the following Database ID: <b>$id</b><br>";
print "server path for showing the images inside you document is: get.php?id=$id";
MYSQL_CLOSE();
} else {
// else show the form to submit new data:
?>
<form method="post" action="<?php echo $PHP_SELF; ?>" enctype="multipart/form-data">
File Description:<br>
<input type="text" name="form_description" size="40">
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000000">
<br>File to upload/store in database:<br>
<input type="file" name="form_data" size="40">
<p><input type="submit" name="submit" value="submit">
</form>
<?php
}
?>
