[PHP-users 14058] Re: =?iso-2022-jp?q?*=1B$B2r7h=1B=28B*?= mysql_fetch_array()=?iso-2022-jp?q?=1B$B$N=1B=28BWarning?=

Yasunari Imado php-users@php.gr.jp
Tue, 18 Mar 2003 14:42:08 +0900


$B%$%^%I$G$9!#<+8J%l%9$G$9!#(B

addslashes() $B$H$$$&4X?t$rCN$j!"<h$jF~$l$?$H$3$m(B
$B$$$A$*$&2r7h$7$^$7$?!#(B
# $B==J,$J%F%9%H$r9T$C$F$$$J$$$N$G(B`$B$$$A$*$&(B`$B$H$$$&$3$H$G$9!#(B

>   $crypt_str = $data['passwd'];

$B$3$N%3!<%I$r(B
    $crypt_str = addslashes($data['passwd']);
$B$H$7$^$7$?!#(B

$B$=$3$G$*J9$-$7$?$$$N$G$9$,!"$_$J$5$s$O(BSQL$BJ8$r07$&$H$-$K$O(B
$BI,$:(Baddslashes()$B4X?t$rMxMQ$5$l$F$$$k$N$G$7$g$&$+(B?


2003$BG/(B3$B7n(B13$BF|(B $BLZMKF|(B 18:27$B!"(BYasunari Imado$B$5$s$O=q$-$^$7$?(B:
> $B$O$8$a$^$7$F!"%$%^%I$H?=$7$^$9!#(B
>
> MySQL $B$N(B ENCODE $B4X?t$r;H$C$F0E9f2=$7$?%l%3!<%I$r(B
> DECODE $B4X?t$GI|85$9$k$H$-(B mysql_fetch_array() $B$G(B Wa=
rning $B$,=P$k(B
> $B%l%3!<%I$,$"$k$N$G$9$,$I$&$d$C$F2sHr$9$l$P$$$$$N$G$7$g$&$+(B?
> $B<hF@$9$k%l%3!<%I$N%U%#!<%k%I7?$O(BMySQL$B$N%^%K%e%"%k$r8+$F!=
"(B
> BLOB$B$K$7$F$"$j$^$9!#(B
>
> $B0J2<$O%3!<%I$N0lIt$G$9!#(B
>
> $query = "SELECT `passwd` FROM `TEST`";
> $result = mysql_query($query);
> while ($data = mysql_fetch_array($result)){
>   // $B0E9f2r=|(B
>   $crypt_str = $data['passwd'];
>   $decode_query = "SELECT DECODE('$crypt_str', '$decrypt_key')";
>   $decode_result = mysql_query($decode_query);
>   $decrypt_passwd = mysql_fetch_array($decode_result);
> .....
>
> Warning$B$,<($99T$O(B
>   $decrypt_passwd = mysql_fetch_array($decode_result);
> $B$NItJ,$G$9!#(B
>
> $B%"%I%P%$%9$h$m$7$/$*4j$$$7$^$9!#(B
>
> -----
> $B%W%m%0%i%_%s%0Nr(B3$B%v7n(B
> MySQL 3.23.52
> PHP 4.2.2
> SuSELinux 8.1

-- 
=================================================^=====
Yasunari Imado
=09sjv@iris.eonet.ne.jp    (PGP Key ID: 2582B3D6)

[SSJV]   http://ssjv.kir.jp/
=================================================^=====