[PHP-users 22594]PHPで表示されない文字(SJIS)への対応
siejp2002
siejp2002 @ yahoo.co.jp
2004年 7月 14日 (水) 16:21:32 JST
$B$$$A$+$H?=$7$^$9!#(B
Windows$B>e$G(BApache + MySQL + PHP$B$rMxMQ$7$?#D#B%7%9%F%`$r3+H/Cf$G$9$,!"0J2<$N(B
$B$h$&$JLdBj$,H/@8$72r7h$G$-$:$K:$$C$F$$$^$9!#$4B8CN$NJ}$,$$$i$C$7$c$$$^$7$?$i(B
$B%U%)%m!<$r$*4j$$$7$^$9!#(B
$B8=>]!'(B
PHP$B$r;H$C$?(BWEB$B%Z!<%8$+$i(BMySQL$B$KBP$7$F%/%(%j$rH/9T$7!"$=$N7k2L$rI=<($9$k$H(B
$BFCDj$NJ8;z!J(Bex.$B!Vy#!W!'(B0xFA5E(Shift-JIS)$B!K$,I=<($5$l$J$$!#(B
$B"(%3%^%s%I%W%m%s%W%H$+$iD>@\(BMySQL$B$KBP$7$F(BSQL$B$rH/9T$7$?>l9g!"@5>o$J%G!<%?$,(B
$BJV$5$l$F$$$k$N$G!"(BPHP$B$GI=<($9$k$H$-$NLdBj$H9M$($F$$$^$9(B
$B4D6-!'(B
OS :WinNT4.0 Server
Apache :Ver2.0.49
PHP :Ver4.3.6
MySQL :Ver4.0.18
$B"(J8;z%3!<%I$O!"(BShift-JIS$B$GE}0l$7$F$$$^$9(B
$B=hM}!J(BPHPLib$B;HMQ!K$O!"35$M0J2<$N$h$&$K5-=R$7$F$$$^$9!#(B
---------------------------------------------------------------------------
//$B%j%_%C%?IU$-(Bselect$B4X?t(B
Function do_select($sub_query, $limit, $offset){
$B!%!%!%(B
//DB_sql class$B%$%s%9%?%s%9:n @ .(B
$db=new authDBSystem;
//$B:GBgI=<(?t$N@)8B$r%/%(%jKvHx$KDI2C(B
$query = $sub_query ." limit " .$offset. "," .$limit;
//$B%/%(%jH/9T(B($B%a%s%P4X?t2~B$(B)
$db->query($query, "ec_db", $auth->auth["uname"], $auth->auth["pass"]);
//$B%l%3!<%I7o?t<hF@(B
$result_rows = mysql_num_rows($db->Query_ID);
if(($result_rows >= 1) OR ($_SESSION['flgSeek'] != 0)){
//$BI=%X%C%@=PNO3+;O(B=========================================================
print <<< EOD1
<CENTER>
<TABLE BORDER="1">
//$B%F!<%V%k$NNsL>$r=PNO(B($B>JN,(B)
EOD1;
//$BI=%X%C%@=PNO=*N;(B=========================================================
//$B;XDj9T?t$@$1%k!<%W$7$F7k2L=PNO(B
while( $row = mysql_fetch_object($db->Query_ID) ){
//$B8!:w7k2L=PNO3+;O(B=========================================================
print <<< EOD2
<TR>
<TH ROWSPAN="2" WIDTH="63" VALIGN="MIDDLE">
<FORM BORDER="0">
<FONT FACE="$B#M#S(B $B%4%7%C%/(B"><INPUT onClick="new_win($row->RYG_CD)"
TYPE="button" SIZE="60" VALUE="
$B>\:Y(B" STYLE="font-size: 14px;"></FONT>
</FORM>
</TH>
<TH WIDTH="110" VALIGN="MIDDLE">$row->RYG_CD</TH>
<TH ROWSPAN="2" WIDTH="63"><FONT
style="font-weight:lighter">$row->ES_CD</FONT></TH>
EOD2;
print <<< EOD3
<TH ROWSPAN="2" WIDTH="50"><FONT
style="font-weight:lighter">$row->RNK_NM</FONT></TH>
<TH COLSPAN="2">
<DIV ALIGN="LEFT"><FONT
style="font-weight:lighter">$row->KJN_YBN_NO</FONT></DIV>
</TH>
<TH ROWSPAN="2" WIDTH="80"><FONT
style="font-weight:lighter">$row->KJN_TEL_1</FONT></TH>
<TH VALIGN="MIDDLE" WIDTH="99"><FONT
style="font-weight:lighter">$row->UPD_YMD</FONT></TH>
</TR>
<TR>
<TH WIDTH="110" VALIGN="MIDDLE"><FONT
style="font-weight:lighter">$row->RYG_NM</FONT></TH>
<TH WIDTH="248">
<DIV ALIGN="LEFT"><FONT
style="font-weight:lighter">$row->KJN_MADR_KNJ</FONT></DIV>
</TH>
<TH WIDTH="161">
<DIV ALIGN="LEFT"><FONT
style="font-weight:lighter">$row->KJN_HADR_KNJ</FONT></DIV>
</TH>
<TH VALIGN="MIDDLE" WIDTH="99"><FONT
style="font-weight:lighter">$row->TTOS_CD</FONT></TH>
</TR>
EOD3;
} //$B%k!<%W=*N;(B
print <<< EOD4
</TABLE>
</CENTER>
EOD4;
//$B8!:w7k2L=PNO=*N;(B=========================================================
PHP-users メーリングリストの案内