You could also get rid of it entirely:
$query = sprintf("SELECT foo FROM bar WHERE foobar=%d OR bar='%s'",
$_GET['id'],
mysql_real_escape_string($_GET['search'])
);
I suppose it's just your preference.
If you're making modifications to the data, however, it's best to store it in a variable so that you still have the data in its original form should you need it later on.