I'm assuming that the second script is run when a link is clicked on the output of the first script. If this is the case then the idname variable should be accessible to the second script as it is in the query string.
A reason why it may not be working for you is because PHP is case-sensitive so $http_get_vars should be $HTTP_GET_VARS (or $_GET if you're using PHP 4.1 or above).
Something completely separate but which is something you may wish to note, not putting quotes around the name's of array elements means that PHP does extra work looking for constants that don't exist so instead of:
$query = "SELECT * FROM accom WHERE id = '$http_get_vars[idname]'";
try
$query = "SELECT * FROM accom WHERE id = '{$HTTP_GET_VARS['idname']}'";
or
$query = "SELECT * FROM accom WHERE id = '".$HTTP_GET_VARS['idname']."'";
both ways will work equally well.
Hope it helps,
Mac