OK, from your second post I gather you're not trying to output an array but a string that you build up within the while loop. You didn't really answer my other question though, "Have you tried anything yet to debug?"
First, use var_dump() to output $mydata. That will show you if the script is reaching that point and what the variable contains, as well as its type and length.
Then, if that is showing either an empty string of zero length, try outputting the query. Maybe it's not the query you think it's running.
If you truly do get a blank page with no output then it sounds like a bigger problem. Make sure that errors are set to display. Failing that, you need to check your error logs.