downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

cubrid_result> <cubrid_put
Last updated: Fri, 24 Sep 2010

view this page in

cubrid_real_escape_string

(PECL CUBRID >= 8.3.0)

cubrid_real_escape_stringReturns the escaped string version of the given string

Description

string cubrid_real_escape_string ( string $unescaped_string [, resource $conn_identifier ] )

This function returns the escaped string version of the given string. It pre-appends backslashes to the following characters: '. This function must always (with few exceptions) be used to make data safe before sending a query to CUBRID.

Parameters

unescaped_string

The string that is to be escaped.

conn_identifier

The CUBRID connection. If the connection identifier is not specified, the last link opened by cubrid_connect() is assumed.

Return Values

Escaped string version of the given string, on success.

FALSE on failure.

Examples

Example #1 cubrid_real_escape_string() example

<?php
    $user 
"'username'";
    
$password "\"pass\"";
    
$query sprintf("SELECT * FROM users WHERE user='%s' AND password='%s'",
            
cubrid_real_escape_string($user),
            
cubrid_real_escape_string($password));
    
    echo 
$query;
?>

The above example will output:

Result:
SELECT * FROM users WHERE user='\'username\'' AND password='\"pass\"'


add a note add a note User Contributed Notes
cubrid_real_escape_string
There are no user contributed notes for this page.

cubrid_result> <cubrid_put
Last updated: Fri, 24 Sep 2010
 
 
show source | credits | sitemap | contact | advertising | mirror sites