Hi Tom

Your SQL looks a little suss to me. You have-
$query = "select VARIABLE from TABLE";
Which is a bit ambiguous. Select implies you are telling your db what to select from the table- i.e. select all or select a particular field. e.g.
$query="SELECT fieldname FROM tbl_tablename WHERE id='$variable'";
Also, you have your script printing-
Print "_root.textfield= $result"; //THIS LINE PRINTS IT INTO THE FLASH MOVIE
to the browser. I would have-
echo "textfield=$result";
Then, within Flash, load the variables into a target or level, as oppose to putting '_root' in your script.
Just my thoughts, hope they help (hope I've understood what you mean!).