how to put ids of users(as per requirement) from a database in an array
<p>I am making a website . In my website i want to fetch certain user ids as per the requirement and store those ids in an array.</p>

<p>Those fetched ids can be different for different users.</p>

<p>following is the code...</p>

<pre><code>@$i=0;
$id=$_SESSION['user_id'];
$qry=@mysql_query("SELECT * FROM sbsto WHERE loginid='$id'");
$nos=@mysql_num_rows($qry);
while($rats=@mysql_fetch_array($qry))
{
    $rat=array($rats['idsub']);         
}
for($i=0;$i&lt;$nos;$i++)
{
    echo $rat;

}
</code></pre>
