Say I have two tables to store user profiles: sm_user_profiles
(social media), and vital_user_profiles
.
Now I want a universal object for accessing profile information. For the sake of clarity, this object is for only one user (the logged-in user) and will not return multiple rows.
Starting with this:
$query = $this->db->query('SELECT * FROM vital_user_profiles WHERE id="1"');
$profile = $query->row();
echo $profile->email;
how can I combine it with this:
$query = $this->db->query('SELECT * FROM sm_user_profiles WHERE id="1"');`
$profile = $query->row();
echo $profile->facebookURL;
so that I can do this?
echo $profile->email.$profile->facebookURL;
I'm new to objects in PHP. Thanks in advance!
sm_user_profiles
andvital_user_profiles
correlated by any id? – Fabio Apr 16 '13 at 5:49