Warning: include_once(/home/sites/heteml/users/m/o/r/moriya-h5/web/confrage/bin/top_msg.php): failed to open stream: No such file or directory in /home/users/2/moriya-h5/web/confrage/php/sql/mysql_real_escape_string/mysql_real_escape_string.php on line 20
Warning: include_once(): Failed opening '/home/sites/heteml/users/m/o/r/moriya-h5/web/confrage/bin/top_msg.php' for inclusion (include_path='.:/usr/local/php/7.4/lib/php') in /home/users/2/moriya-h5/web/confrage/php/sql/mysql_real_escape_string/mysql_real_escape_string.php on line 20
目次 |
---|
・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"; ?>