You'll have to save the variable names that you created into an array, then unset all of them:
$created_vars = array();
while ($row = mysql_fetch_array($result)){
$var = $row[1];
$created_vars[] = $var;
$$var = $row[2];
}
foreach( $created_vars as $var) {
unset( $$var);
}
That being said, you should consider abandoning variable-variables, and just use an array.