[前][次][番号順一覧][スレッド一覧]

mysql:2032

From: hama <hama <KHC01210@xxxxxxxxxx>>
Date: Wed, 17 May 2000 00:52:58 +0900
Subject: [mysql 02032] Re: データベースに画像ファイルを保存できますか?

#!/usr/local/bin/perl
use DBI;
# <IMG SRC="このCGIおよびItemCodeパラメタ">のようにHTMLから呼び出す
# 本ソースはjpeg形式のみ対応

# DB接続
# host,user,passwdは適宜読み替えてください
$dbh = DBI->connect("DBI:mysql:host","user","passwd");
$ItemCode = $ENV{'QUERY_STRING'};
$s = "SELECT ItemPict FROM Items WHERE ItemCode='$ItemCode'";
$sth = $dbh->prepare($s) || die "Can't Prepare $s:$dbh->errstr\n";
$rv = $sth->execute || die "Can't execute\n";
@row = $sth->fetchrow_array;
print "Content-Type: image/jpeg\n";
print "Pragma: no-cache\n\n";
print $row[0];
$dbh->disconnect;


[前][次][番号順一覧][スレッド一覧]

      2015 2000-05-16 10:55 [<endo@xxxxxxxxxx>   ] [Q] Perl ではどう使う?                 
      2016 2000-05-16 11:53 ┣["Y. Tutui" <tutui@xx]                                       
      2018 2000-05-16 14:12 ┃┗[<endo@xxxxxxxxxx>   ]                                     
      2019 2000-05-16 15:27 ┃ ┗[<endo@xxxxxxxxxx>   ]                                   
      2020 2000-05-16 19:20 ┃  ┗[Seiji Tateyama <tate]                                 
      2021 2000-05-16 19:40 ┃   ┣[Seiji Tateyama <tate]                               
      2022 2000-05-16 19:52 ┃   ┗["Y. Tsutsui" <tutui@]                               
      2024 2000-05-16 23:03 ┃    ┗[tateyan <tateyan@xxx]                             
      2026 2000-05-16 23:20 ┃     ┗[tateyan <tateyan@xxx]                           
      2027 2000-05-17 00:00 ┃      ┗[tateyan <tateyan@xxx]                         
      2028 2000-05-17 00:14 ┃       ┣["Ningfeng Yang" <yan] データベースに画像ファイルを保存できますか?
   @  2031 2000-05-17 00:21 ┃       ┃┗[hama <KHC01210@xxxxx]                     
->    2032 2000-05-17 00:52 ┃       ┃ ┣[hama <KHC01210@xxxxx]                   
      2034 2000-05-17 01:05 ┃       ┃ ┃┗["Ningfeng Yang" <yan]                 
      2033 2000-05-17 00:58 ┃       ┃ ┗["Ningfeng Yang" <yan]                   
      2043 2000-05-17 08:39 ┃       ┗[<endo@xxxxxxxxxx>   ]                       
      2017 2000-05-16 12:03 ┣["Akinobu Yamamoto" <]                                       
      2044 2000-05-17 10:23 ┗[Satoshi Koiwa <koiwa]                                       
      2045 2000-05-17 10:35  ┣[<endo@xxxxxxxxxx>   ]                                     
      2046 2000-05-17 10:42  ┗["Y. Tsutsui" <tutui@]