Users are stored in the users table with a unique 'user_id'. Contacts are stored in contacts table. They are linked to the user by 'user_id'. So if you have messed the 'user_id' field in users table, contacts are still in the contacts table but the link to the user is lost which results in an empty address book.