array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'function.mysql-escape-string.php', 1 => 'mysql_escape_string', ), 'up' => array ( 0 => 'ref.mysql.php', 1 => 'MySQL İşlevleri', ), 'prev' => array ( 0 => 'function.mysql-error.php', 1 => 'mysql_error', ), 'next' => array ( 0 => 'function.mysql-fetch-array.php', 1 => 'mysql_fetch_array', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/mysql/functions/mysql-escape-string.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.0.3, PHP 5)
mysql_escape_string — Escapes a string for use in a mysql_query
PHP 4.3.0 itibariyle bu işlevin kullanımı önerilmemekte olup bu işlev ve özgün MySQL eklentisinin tamamı PHP 7.0.0 itibariyle kaldırılmıştır. Yerine, etkin olarak geliştirilmekte olan MySQLi veya PDO_MySQL extensions kullanılabilir. Ek bilgi: MySQL: Bir API Seçimi Bu işlev yerine kullanılabilecekler:
This function will escape the unescaped_string
,
so that it is safe to place it in a mysql_query().
This function is deprecated.
This function is identical to mysql_real_escape_string() except that mysql_real_escape_string() takes a connection handler and escapes the string according to the current character set. mysql_escape_string() does not take a connection argument and does not respect the current charset setting.
unescaped_string
The string that is to be escaped.
Returns the escaped string.
Örnek 1 mysql_escape_string() example
<?php
$item = "Zak's Laptop";
$escaped_item = mysql_escape_string($item);
printf("Escaped string: %s\n", $escaped_item);
?>
Yukarıdaki örneğin çıktısı:
Escaped string: Zak\'s Laptop
Bilginize:
mysql_escape_string() does not escape
%
and_
.