mysql_fetch_object mystery (php5)

Hi, folks.

I am rather new to PHP. I am creating an application where I am using AMFPHP, Flex and MySQL.

On one of my php methods I am trying to return a value object or a mysql query.

return mysql_fetch_object($result);

This returns a simple object with the properties of the object set to that data retrieved in the database (as expected). However I want to be able to do this:

return mysql_fetch_object($result, "UserVO");

When doing so it returns the expected object type (a UserVO), however it returns the values of the UserVO to their initialized values which are various strings. It is not setting the values of the properties to that which are found in the database.

Here is my UserVO php class:

<?php
class UserVO
{
    var $_explicitType = "UserVO";
    
    var $id = 0;
    var $userName = 'userName';
    var $password = 'password';
}
?>

What am I missing here? Again I am a complete PHP noob.