[PHP-users 32236] Re: PHP+MSSQLでJpegデータの登録・表示の方法

Hirao hirao @ stannet.ne.jp
2007年 5月 31日 (木) 18:18:59 JST


moricci $B$5$s!"$3$s$K$A$O(BHirao$B$G$9!#(B

$B%3%a%s%H$"$j$,$H$&$4$6$$$^$9!#(B

$B#D#B$X$NEPO?$NItJ,$HCj=P$NItJ,$N @ Z$jJ,$1$H$7$F(B
$BJL$N(BWindows$B%"%W%j$r:n @ .$7$F!"(BPHP$B$G(BInsert$B$N$"$H#D#B$+$i(BImage$B%G!<%?$NI=<((B
$B$r$7$F$_$^$7$?$i @ 5$7$/I=<($5$l$^$7$?!#(B
Insert$B$O$&$^$/F0:n$7$F$$$k$H9M$($^$9!#(B


$B$I$&$b(B
$result = mssql_query("SELECT IMAGE  FROM T_IMAGE WHERE NO=1",$db);
$row = mssql_fetch_assoc($result);

header("Content-type: image/jpeg;");
echo $row["IMAGE"];

$B$N5-=R$KLdBj$,$"$k$H;W$$$^$7$?!#(Bmoricci $B$5$s$N$4Ds<($N(B

>echo pack("H*",$row["IMAGE"]);$B!!$G$O$J$$$G$7$g$&$+!#(B
$B$b;n$7$^$7$?$,:#EY$O%o!<%K%s%0$,I=<($5$l$^$7$?!#(B
Warning: pack() [function.pack]: Type H: illegal hex digit $B(Bin C:
\xampplite\htdocs\hosho\test01.php on line 17

ASP$B$N$H$-$K$O!!(BResponse.BinaryWrite RS("IMAGE")$B!!$H$$$&%3!<%I$r5-=R$7$?(B
$B$N$G$9$,!"(BPHP$B$K$b(BBinaryWrite$B!!$N$h$&$J=q$-J}$O$J$$$b$N$G$7$g$&$+!)(B
$B$&!<!<$s!"$b$&>/$7$N$H$3$J$s$G$9$1$I$M(B....

>MSSQL$B$O?($C$F$$$^$;$s$,!"(BMySQL$B!"(BPostgres$B$GF1MM$N$3$H$,2DG=$G$9!#(B
$B;d$b=q @ R$GJY6/Cf$J$s$G$9$1$I!"(BMySQL$B!"(BPostgres$B$NO"7H$OB?$$$N$G(B
MSSQL$B$GF1$8$3$H$,$G$-$J$$$N$,2y$7$/$FD)@o$7$F$$$^$9!#(B




PHP-users メーリングリストの案内