Monday, January 18, 2010

A way to prevent SQL injection in PHP

Add this function into yr code.

function cleanInputData($data)
{

$cleaned = trim($data);
$cleaned = mysql_real_escape_string($cleaned);
return $cleaned;

}

No comments: