i get an error when im trying to echo the name of the user.
Code for select
public function profile($username){
$result = mysql_query("SELECT * FROM " . PFX . "employees WHERE email ='$username'");
$employee = array();
while($rows = mysql_fetch_assoc($result)){
$employee[] = $rows;
return $employee;
}
}
On page:
$employee = $user->profile($username);
<?php echo $employee['name']; ?>
I tried to print_r($employee); which outputted the following:
Array ( [0] => Array ( [id] => 4 [name] => Test Person...
So it does get the user from the database, but it cant echo only the name, can someone see where the error are?
I know the code isn't updated..