MySQL Real Escape String

Submitted by:Jhon Brain

Date added:24 July, 2013

Category:PHP

An example of how to use the mysql_real_escape_string

Tags: string , escape

Code Snippet:

    <?php  
$db_connect=mysql_connect($host, $user, $pass);
$insert = mysql_query("UPDATE database SET username = '".mysql_real_escape_string($new_username)."' where username = '".mysql_real_escape_string($user)."'");
?>
 
 

Comments