Hi, i am tryin to populate a listbox from a php page, but doesnt seem 2 work properly
php code:
flash code:
in the box, i get undefiend, undefiend
why is this??
what is wrong with the code??
Regards,
Martin
Gaming Help And Info:
php code:
Code:
<?php
include "../../nep-yb/config.php";
$i=0;
$qT = mysql_query("SELECT uid FROM member");
$amt = mysql_num_rows($qT);
echo "&amnt=$amt";
//
$i=0;
$q = mysql_query("SELECT uid, nick FROM member") or die(mysql_error());
while(list($uid,$n) = mysql_fetch_row($q)){
echo "&user[$i]=$n&uid[$i]=$uid";
$i++;
}
?>
Code:
//init
lv = new LoadVars();
lv.onLoad = function() {
for (var i = 0; i<this.amnt; i++) {
userList.addItem({label:this[user+i], data:this[uid+i]});
}
};
lv.sendAndLoad('[URL unfurl="true"]http://www.webrevolt.biz/work/lobby/getUserList.php',[/URL] lv, 'post');
function showMenu() {
trace(userList.selectedItem.data);
}
//
userList.addEventListener("change", showMenu);
in the box, i get undefiend, undefiend
why is this??
what is wrong with the code??
Regards,
Martin
Gaming Help And Info: