Remark : 특수 문자 때문에 쿼리 오류가 발생한다.
1 2 3 4 5 6 7 |
$nation = "Lao, People's Dem. Rep."; $query = "SELECT * FROM CITY where country_english ='$nation'"; # ERR |
addslashes()
1 2 3 4 5 6 7 8 9 |
$nation = "Lao, People's Dem. Rep."; $nation = addslashes($nation); $query = "SELECT * FROM CITY where country_english ='$nation'"; # OK |
stripslashes() \’ 원복
1 2 3 4 5 6 7 |
$string = "I'am a boy"; $a = addslashes($string); print $a; $b = stripslashes($a); print $b; |