快速方法从mysql 5.0中检索数据并推送php

I am using MYSQL 5.0 & PHP . In my Database I am having 1 Million USERS entries. Now i am using following query.

SELECT ID FROM USERS;

fetching these values in PHP array for the further use like as follow .

$Userid = array();
for($i=0;$<sizeof($IDArray);$i++)
{
$Userid[$i] = $IDArray[$i];
}

This method is so expensive for me , taking huge time & bursting my further operations. Mysql INDEX method i am not able to use here. Suggest any method which i can use here.

I am trying to collect all ID(Primary Key) from user table . Using all users IDs , i am going to calculate how many comment , views on a particular article post of the users.

For Eg. ID = 1

On Id 1 , one user registered for example Smith Joseph. Smith having 10 Article Post.
I want to write a program to find the on which Article post having maximum views and comment count.

I hope the idea is clear now !