Where is "$id" coming from? I don't see it defined.
EDIT: Also, this:
echo "$row[text]\n";
Has 2 problems. One being that array items aren't referenced inside a string, rather concantenated. Also, the array key should be treated as a string, i.e. delimited by quotes. Here's an example:
echo $row['text'] . "\n";
or, using braces,
echo "{$row['text']}\n";
At any rate, I don't think your code will go awry, though it's definitely not a good coding style/habbit.