I am not sure on how to help you with this out,
this is because I've never done so before. Why would you put files inside a
database. Just copy them in some folder and name within a logic, inserting
only a small string in your DB or even without it. Then call the graphic.
This is easier, faster, reliable, extendable.
All these different databases support files to simply not to lose the war
with their competitors. Not much programmers use it.
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED]
www.phpbeginner.com
-----Original Message-----
From: Siim Einfeldt aka Itpunk [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 8:01 PM
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] problems with writing picture to the database.
O.K. I still got the problems. I`ll paste everything needed here and
please, if anyone knows how to make it work, let me know.
*First, the part of the form is the following:
<INPUT TYPE="file" NAME="file">
the enctype in my form tag is ENCTYPE="multipart/form-data" and METHOD =
POST
*The code that actually *should* take care of the upload process to
mysql, is the following:
if (isset($file) AND $file != "none" AND strlen($file)>2){
$file_data = fread( fopen($file, 'r'),
filesize($file) );
$theq = "INSERT INTO pildid
(file_name,file_type,file_data,tyyp,subid,picnr) VALUES ('$file',
'$file_type', '".addslashes($file_data)."','travels','$it','0')";
$result = mysql_query($theq);
}
And the errors I get, are':
Warning: fopen("C:\\ajutine\\Kevad.jpg","r") - No such file or directory
in /home/einfeldt/public_html/bt2/reis.php3 on line 62
Warning: Supplied argument is not a valid File-Handle resource in
/home/einfeldt/public_html/bt2/reis.php3 on line 62
INSERT INTO pildid (file_name,file_type,file_data,tyyp,subid,picnr) VALUES
('C:\\ajutine\\Kevad.jpg', '', '','travels','9','0')
Thanks
Siim Einfeldt
--
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]
--
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]