Hello guys, I am trying to create a user class.
I am looking to extract the contents of a mysql table into a defined array
$user[id] <- I want to extract all the table into a array according to its id field..
so i can then call
$user[3][name] gives the name of the user whois id is 3
$user[7][email] gives the email of the user whois id is 7
and e.t.c
How would I go on making the array(The structure)
edit: hrmm am i close:
var $users[] = array('username' => '', 'email' => '');
then
while ($row = mysql_fetch_array) {
$users[$row['id']] = array('username' => row['username']);
}