..you couldn't perform your query somehow and the result isn't there...
If RID is writen like that meaning the same letter capitalisation then there is something else wrong with it...
Are you connected with the database and all? Then, is the table name correct? If all of these thing are correct try renaming your $query to something else (getting out of ideas really...) if that fails try running the query through phpMyAdmin if you have it and see what it says...
Then post back here and let us know of the results...