You're not showing the point where the error occurs. 'Page contains no data' means literally that, so if your php script outputs a <BODY> section that contains anything at all you won't get this error. So I would recommend double-checking that first. If you're printing any kind of title on the page, you might get a page that says:
RECOMMENDED LINKS
and nothing else, instead of the error message you're getting.
As a further refinement, you could check each of the variables and, if they are all equal to "", then print an alternative message (e.g. "Sorry, no recommending links are available from this user.")