RE: [PHP] image upload/display
| From: | indrek siitan | Date: | Thu, 21 Dec 2000 15:20:53 +0000 |
| Subject: | RE: [PHP] image upload/display | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-31437@lists.php.net to get a copy of this message | ||
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 >==--