Article View: pl.comp.lang.php
Article #2057Re: blob i pliki gif
From: kRuK
Date: Mon, 03 Sep 2001 09:27
Date: Mon, 03 Sep 2001 09:27
22 lines
1835 bytes
1835 bytes
> w jaki sposób można w bazie mysql umieścić plik gif albo jpg?
> i w jaki sposób można go wyciągnąć przy pomocy php aby umieścić go na
stonie
> www??
przy strukturze bazy $im_id Auto Incerment INT, $im_body BLOB
$query="Insert Into Image_Base
Values(NULL,LOAD_FILE(\"$image_path\"));";
$sql_answer=mysql_query($query);
a wyciagniecie z bazy na strone poporzez
header ("Content-type: image/jpeg");
$query="SELECT Image_body FROM Image_Base WHERE Im_ID='$image'";
$sql_answer=mysql_query($query,$mysql_link);
$answer=mysql_fetch_object($sql_answer);
$im=imagecreatefromstring($answer->Image_body);
imagejpeg($im);
imagedestroy($im);
pzdr kRuK
P.S.zasadniczo nie 3ma sie obrazkow w bazie
Technical Details
Message-ID:
<9mvi6l$g1k$1@h1.uw.edu.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!mat.uni.torun.pl!news.man.torun.pl!news.icm.edu.pl!mimuw.edu.pl!news.mimuw.edu.pl!uw.edu.pl!not-for-mailReferences:
<3b934519$1@news.vogel.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!mat.uni.torun.pl!news.man.torun.pl!news.icm.edu.pl!mimuw.edu.pl!news.mimuw.edu.pl!uw.edu.pl!not-for-mail From: "kRuK" <kruk75@interia.pl> Newsgroups: pl.comp.lang.php Subject: Re: blob i pliki gif Date: Mon, 3 Sep 2001 11:27:19 +0200 Organization: A poorly-installed InterNetNews reader Lines: 24 Message-ID: <9mvi6l$g1k$1@h1.uw.edu.pl> References: <3b934519$1@news.vogel.pl> NNTP-Posting-Host: stocznia.sssa.com.pl X-Trace: h1.uw.edu.pl 999509013 16436 212.160.133.226 (3 Sep 2001 09:23:33 GMT) X-Complaints-To: usenet@h1.uw.edu.pl NNTP-Posting-Date: 3 Sep 2001 09:23:33 GMT X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MSMail-Priority: Normal X-Notice1: This post has been postprocessed on the news.uw.edu.pl server. X-Notice2: Subject line has been filtered and any Odp: strings removed. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit