hi to all
i am making a chat app using php/mysql
i am faceing a problem here ..i want that user click on button and it give him a random online user from database...but dont know how to do it ..i am trying..
{
$i=0;
while ($i < $num)
{
$f1=mysql_result($result,$i,"MemberUserName");
$i++;
<a href="#" onclick="setCurrentUser('<?php echo $f1; ?>');">
}
}
here i am getting values from database and storing them into $f1 and calling setCurrentUser to pass user...but i want random..
function setCurrentUser (userName)
{
if (isMoiveLoaded = true)
{
if (navigator.appName.indexOf("Microsoft") != -1)
{
document.getElementById('chatApp').SendUserName(userName);
}
else
{
document.chatApp.SendUserName(userName);
}
}
else
{
alert ("let the flash content load firt please");
}
}
i just want that onclick give me random user for chat ...