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

mysql:3187

From: 楠吉彦 <楠吉彦 <moredebu@xxxxxxxxxx>>
Date: Wed, 07 Feb 2001 12:57:46 +0900
Subject: [mysql 03187] Re: バイナリーデータの扱いについて

php3で画像データをmysql に入れるときにどんなバイナリーでも
入れられたと思いますが、この話の流れはライブラリーのバグの話なのでしょうか
それとも簡単にバイナリーをほりこむ話なのでしょうか

<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<TITLE>UPLOAD</TITLE>
</HEAD>
<BODY>
<?
 echo "Upload file Information.<BR>\n";
 echo "<TABLE BORDER=1>\n";
 echo "<TR><TD>Server temporaly file name</TD><TD>$userfile </TD></TR>\n";
 echo "<TR><TD>Uploaded file name</TD><TD>$userfile_name </TD></TR>\n";
 echo "<TR><TD>Uploaded file Size</TD><TD>$userfile_size </TD></TR>\n";
 echo "<TR><TD>MIME file type</TD><TD>$userfile_type </TD></TR>\n";
 echo "<TR><TD>scode</TD><TD>$scode</TD></TR>\n";
echo "<TR><TD>rno</TD><TD>$rno</TD></TR>\n";
echo "<TR><TD>tekiyo</TD><TD>$tekiyo</TD></TR>\n";
echo "<TR><TD>message</TD><TD>$message</TD></TR>\n";
 echo "</TABLE>\n";
 echo "<HR>";
$db = mysql_connect("localhost", "root","********");     
if(!mysql_select_db("mydb",$db)){
echo ("Cannot select database.\n");
}

if($userfile=="none" or $userfile==''){
 echo "It was not uploaded.<BR><HR>";
}else{
 $fp=fopen($userfile,"r");
 $Binary=addslashes(fread($fp, filesize($userfile)));
 fclose ($fp);
 unlink($userfile);
 $query="insert into  sjyoho (rno,tekiyo,message,scode,photo,pimg,mime)
                      values ('$rno','$tekiyo','$message','$scode','$userfile_name','$Binary','$userfile_type')";

//values('','$userfile_type','$userfile_name','$Binary')";


 if(mysql_query($query)){
  echo("Write data sucessfully.<BR>");
 }else{
  echo("Write data Failure.<BR>");
 };
 echo ("<HR><BR>");
};
?>
</BODY>
</HTML>
楠吉彦 もあでぶ moredebu
email: moredebu@xxxxxxxxxx
Homepage: http://www.my-drug.com

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

      3156 2001-02-05 16:31 ["Mitsuru Maruno" <ma] バイナリーデータの扱いについて          
      3158 2001-02-05 23:19 ┣[Toshihiro Fujimori <]                                       
      3160 2001-02-06 10:26 ┃┗["Mitsuru Maruno" <ma]                                     
      3161 2001-02-06 10:43 ┃ ┗[Yoshiyuki Asano <asa]                                   
      3162 2001-02-06 11:06 ┃  ┗["Mitsuru Maruno" <ma]                                 
      3163 2001-02-06 12:56 ┃   ┗[Yoshiyuki Asano <asa]                               
      3164 2001-02-06 13:24 ┃    ┣[Yoshiyuki Asano <asa]                             
      3165 2001-02-06 13:32 ┃    ┗["Mitsuru Maruno" <ma]                             
      3166 2001-02-06 14:07 ┃     ┗[Yoshiyuki Asano <asa]                           
      3168 2001-02-06 14:30 ┃      ┣["Mitsuru Maruno" <ma]                         
      3169 2001-02-06 14:52 ┃      ┗[Akihiko Shinohara <s]                         
      3170 2001-02-06 15:09 ┃       ┣[Yoshiyuki Asano <asa]                       
      3171 2001-02-06 15:11 ┃       ┗["Mitsuru Maruno" <ma]                       
      3172 2001-02-06 17:02 ┃        ┗[Tomohiro KATO <tomop]                     
      3173 2001-02-06 17:19 ┃         ┗["Mitsuru Maruno" <ma]                   
      3174 2001-02-06 17:28 ┃          ┣[Tomohiro KATO <tomop]                 
      3182 2001-02-07 10:11 ┃          ┃┗["Mitsuru Maruno" <ma]               
      3175 2001-02-06 17:29 ┃          ┗["Mitsuru Maruno" <ma]                 
      3179 2001-02-06 23:45 ┃           ┗[Toshihiro Fujimori <]               
      3180 2001-02-07 00:41 ┃            ┣[Toshihiro Fujimori <]             
      3183 2001-02-07 10:30 ┃            ┗["Mitsuru Maruno" <ma]             
      3184 2001-02-07 10:50 ┃             ┗[Akihiko Shinohara <s]           
      3185 2001-02-07 11:13 ┃              ┗["Mitsuru Maruno" <ma]         
      3186 2001-02-07 12:11 ┃               ┗["Mitsuru Maruno" <ma]       
->    3187 2001-02-07 12:57 ┃                ┣[楠吉彦  <moredebu@xx]     
      3188 2001-02-07 15:29 ┃                ┣[Akihiko Shinohara <s]     
      3189 2001-02-07 15:35 ┃                ┃┗[Akihiko Shinohara <s]   
      3190 2001-02-07 16:02 ┃                ┃ ┗["Mitsuru Maruno" <ma] 
      3191 2001-02-07 18:18 ┃                ┃  ┗[Akihiko Shinohara <s]   
      3192 2001-02-07 21:46 ┃                ┗[Toshihiro Fujimori <]     
      3195 2001-02-08 01:16 ┃                 ┗[とみたまさひろ <tomm]   
      3177 2001-02-06 23:05 ┗[Tomohiro Takahashi <]