RE: [PHP] image upload/display
| From: | Siim Einfeldt aka Itpunk | Date: | Thu, 21 Dec 2000 17:50:46 +0000 |
| Subject: | RE: [PHP] image upload/display | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-31448@lists.php.net to get a copy of this message | ||
Hey,
Yes, I`m using 3.23 and yes, it seems easier way to write this stuff to
db, but still, have you any idea why the image won`t be displayed (instead
I just see that there *should* be an image)
thx__________
Siim Einfeldt
> Hi,
>
> > $data = addslashes(fread(fopen($form_data, "r"),
> > filesize($form_data)));
> > mysql_query("INSERT INTO
> > pildid (tyyp,subid,pic,picname,picnr,content_type) VALUES
> > ('".$tyyp."',
> > '".$subid."', '".$data."',
> > '".$picname."',
> '".$picnr."','".$form_data_type."')");
>
> if you're using MySQL 3.23, you can instead of that do:
>
> chmod($form_data,0644); // make the file readable by mysql
> mysql_query("INSERT INTO pildid (pic)
> VALUES(LOAD_FILE('".$form_data."')");
>
>
> Rgds,
> Tfr
>
> --==< tfr@cafe.ee >==< http://tfr.cafe.ee/
> >==< +372-50-17621 >==--
>