The query will return a resource.
That I imaging is what you are seeing is the resource id #2, which means that is the 2nd resource allocated by PHP during the scripts execution.
This is due to trying to print out the actual result resource rather than reading from the resource via your db_fetch functions.
Files and any other system resource will always be displayed as a place holder when told to print itself, since it cannot be printed by reference. Same goes for objects and arrays or any other reference to data types that are not strings or ints.
That's why you are provided all sorts of functions to read and write or otherwise manage system resources external to PHP.