| 目次 |
|---|
|
・mysql_real_escape_string ・サンプルコード ・サンプル |
(php部)
<?php
// 元の文字列
$string = "Let's Go!";
print "元の文字列";
print "$string";
// MySQLサーバーへの接続
$db=mysql_connect('mysql_host','mysql_user','mysql_password');
if(!is_resource($db)){
print "MySQLサーバーへの接続失敗";
exit();
}
// エスケープ後の文字列
$string_escape = mysql_real_escape_string($string);
print "エスケープ後の文字列";
print "$string_escape";
?>