Php to dynamic text...¡help!

hi, i’ve been pulling my hair out over this for some time… first off, let it be known that i’m not so much a programmer as a designer. nonetheless, i can weave through code. so, i’ve been trying to update a site that i took over that already had php code written. i am trying to take some of that php code and run it into a dynamic text field inside of a movie clip called ‘linkorgy’. the var name for the text field is ‘textbox’. i’m not sure if the problem is php or flash, but the php pulls up a white screen, and the flash bit in output returns undefined.
here’s the php bit that i co-opted that works outside of flash:

<?php
$db = mysql_connect(“dbxx”, “dboxx”, “xxx”);
mysql_select_db(“dbxx”);
$sql = ‘SELECT * FROM htmini WHERE 1 ORDER BY id DESC LIMIT 0 , 10’;
$links = mysql_query($sql);
$totalViewable=mysql_num_rows($links);
for($i=0; $i<$totalViewable; $i++){
$link = mysql_fetch_array($links);
echo ‘<li><a href="’.$link[‘url’].’">’.$link[‘title’].’</a></li>’;
}
mysql_close($db);
?>

here’s me trying to fix the code so flash pulls it in:

<?php
$db = mysql_connect(“dbxx”, “dboxx”, “xxx”);
mysql_select_db(“dbxx”);
$sql = ‘SELECT * FROM htmini WHERE 1 ORDER BY id DESC LIMIT 0 , 10’;
$links = mysql_query($sql);
$totalViewable=mysql_num_rows($links);
for($i=0; $i<$totalViewable; $i++){
$link = mysql_fetch_array($links);
‘linkorgy=’.urlencode(’<li><a href="’.$link[‘url’].’">’.$link[‘title’].’</a></li>’);
}
mysql_close($db);
?>

here’s one more feeble try:

<?php
$db = mysql_connect(“dbxx”, “dboxx”, “xxx”);
mysql_select_db(“dbxx”);
$sql = ‘SELECT * FROM htmini WHERE 1 ORDER BY id DESC LIMIT 0 , 10’;
$links = “”;
$links = mysql_query($sql);
$totalViewable=mysql_num_rows($links);
for($i=0; $i<$totalViewable; $i++){
$link = mysql_fetch_array($links);
link1=’<li><a href="’.$link[‘url’].’">’.$link[‘title’].’</a></li>’;
}
echo ‘linkorgy=’.urlencode("<font size=“14”><b>linkorgy</b></font><br><br>$links");
mysql_close($db);
?>

and here’s the AS i have on a blank frame:

var lv:LoadVars = new LoadVars();
lv.onLoad = function (success) {
if(success){
trace(lv.textbox);
}else{
trace(“failed to load”);
}
}
lv.load(“linkorgy.php”);

what am i doing wrong? using flash 8 and AS 2.0

any help would be greatly appreciated. this is all for a kind of crazy looking group posting site called ‘happytedium.com’. thank you so much for your help, whomever you are.