vendredi 8 juillet 2016

select maltiple data from table but recieve one by one data mysql

here where the username fetch all at once but I want to fetch it one by one and print line by line .

$query="SELECT first_name from ".TABLE." WHERE status='Active'"; $result=@mysql_query($query); $data=@mysql_fetch_array($result, MYSQL_ASSOC);

$friends_online = Array();
while ($row = @mysql_fetch_array($result, MYSQL_ASSOC)) {
    $friends_online[] =  $row;  
}
$name=Array();

foreach($friends_online as $f)
{
        for ($i=0;$i<=count($name);$i++)
        {

            $name = $f;
            echo $name;

        }


}

Output is

prashantadminuser1user2

output

So please give me some advice that where I've mistake or what I forgot.

Thanks in Advance......

Aucun commentaire:

Enregistrer un commentaire