It has to do with your use of quotes.
You start the string with a ", then have another " right before $HTTP_COOKIE_VARS. This means the string stops there and the next
thing the parser finds is a variable name, right after the string, without a valid string operator. Also, there's a latent error there regarding single-quotes around what (I assume) are data for text fields.
Change it to read:
$select_query = "SELECT id_num, username, password, email, level, info
from $tablename WHERE username = ' "
. $HTTP_COOKIE_VARS['username']
. " ' AND password = ' "
. $HTTP_COOKIE_VARS['password']
. " ' "'
In an attempt to make the two different kinds of quote readable, I've put in an extra space where it doesn't belong. In reality, the single and double quotes should be right up against each other with no intervening spaces, but if I write it that way here its unreadable.