If you have login working, that would suggest that your session-related code is working and essentially complete.
In order to associate a 'favorite' of any kind with a user, you should probably create a table called something like user_favorites with two fields:
user_favorites
user_id
item_id
When a user clicks 'add to favorites' then you need to make that link point to some page to handle the favorite addition. It might look something like this:
<a href="handle_favorites.php?user_id=23&item_id=12345">ADD TO FAVORITES!</a>
This link should associate item #12345 with user #23 by creating a database record in the table user_favorites. If you need to create that link, you should retrieve the current user_id from the session variables and the item_id should be the correct id for whatever item they are trying to add to their favorites. If they are looking at house number 947, then the link on that page should have item_id = 947.
A script to add a record to the user_favorites table based on that link might look like this:
<?php
/**** handle_favorites.php ****/
// fetch the user_id and item_id from the URL used to access this script
$user_id = intval($_GET['user_id']);
$item_id = intval($_GET['item_id']);
mysql_connect('localhost', 'username', 'password'); // change these values to the ones that work on your server
mysql_select_db('database_name'); // change this value to your database's name
$sql = "INSERT INTO user_favorites (user_id, item_id) VALUES $user_id, $item_id";
mysql_query($sql)
or die('query failed!');
// now redirect to show the list of favorites
header('location: favorites.php'); // change this to whatever page shows your user favorites
?>