Well, the first step to debugging is to remove the @ and see if the query is failing.
Now, that said, there's nothing in your post about your database content. If you have a field that would contain the text "financealert", why not just put that in the query?
<?php
db_conn(); // whatever your connection setup code is....
$query="select $alertfieldname from users where $alertfieldname='financealert'";
$result=mysql_query($result);
if ($result) {
// Javascript alert code here
}