Friday, 10 October 2014

how to stroe data in sql with put any space with in letter


(PHP 4 >= 4.3.0, PHP 5)
mysql_real_escape_string — Escapes special characters in a string for use in an SQL statement
Warning
This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLior PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include:

Description ¶

string mysql_real_escape_string ( string $unescaped_string [, resource $link_identifier = NULL] )
Escapes special characters in the unescaped_string, taking into account the current character set of the connection so that it is safe to place it in a mysql_query(). If binary data is to be inserted, this function must be used.
mysql_real_escape_string() calls MySQL's library function mysql_real_escape_string, which prepends backslashes to the following characters: \x00\n\r\'" and \x1a.
This function must always (with few exceptions) be used to make data safe before sending a query to MySQL.
Caution

Security: the default character set

The character set must be set either at the server level, or with the API function mysql_set_charset() for it to affect mysql_real_escape_string(). See the concepts section on character sets for more information.

Parameters ¶

unescaped_string
The string that is to be escaped.
link_identifier
The MySQL connection. If the link identifier is not specified, the last link opened by mysql_connect() is assumed. If no such link is found, it will try to create one as if mysql_connect() was called with no arguments. If no connection is found or established, an E_WARNING level error is generated.

Return Values ¶

No comments:

Post a Comment