Forum Moderators: coopster
$result = mysql_query("SELECT * FROM xyz");
while($row = mysql_fetch_array($result))
{
if($input==$row['abc'])
{
//code here
}
}
Is there a better (more secure, faster, etc) way of doing this?
$result = mysql_query("SELECT * FROM xyz where abc = '".[url=http://www.php.net/mysql-real-escape-string]mysql_real_escape_string[/url]($input)."'");
This properly escapes characters in the variable that could potentially be used for mysql injection.