Junior Grossi wrote:
> Wade,
> 
> You dont have to change the database table.
> For example:
> 
> If you have a users table but you dont have the 'country' field you
> only have to do this:
> 
> $user = new DatabaseObject_User();
> $user->load(1234); //the user id that you want
> $user->profile->country = 'brazil ;
> $user->save();
> 
> This will add another row on 'users_profile' table:
> 
> - user_id = 1234
> - profile_key = 'country'
> - profile_value = 'brazil'
> 
> Your 'users' table is the same, you only have added a new column on
> 'users_profile' table with a link to your user.
> 
> So if you want get the user's country:
> 
> $user = new DatabaseObject_User();
> $user->load(1234);
> echo $user->profile->country;
> 
> This will automatically do a select into users and users_profile
> (join) tables and group into the $user object;
> 
> Ok?
> 
> Junior Grossi

20081012 1713 GMT-6

Ah, that makes more sense.
Hummmm. Im going to get that book because that looks like it would be 
super helpful. :)

Wade

Reply via email to