I'm not sure how to test this and can't find it on Google... is it acceptable to do this:
$string = mysql_real_escape_string($dbh, $_GET['string']);
$query = sprintf("SELECT * FROM table WHERE column = '%s'",
$string);
When I doing MATCH..AGAINST or INSERT..ON DUPLICATE KEY I have multiple %s that are the same thing, so I'm just not sure if it's marginally faster to just run mysqli_real_escape_string() one time, or if that's doing something weird that defeats the purpose. The fact that it uses $dbh as the first parameter makes me confused about how the whole process works.