title: How to store Profile Views to show each user who's viewed their profile?
body: <p>If we wanted to show each user which users of the opposite sex have viewed their profile, what would be the best way to keep track of all those views in MySQL?</p>
  
  <p>Each user has a unique <code>userid</code> from the main <code>Users</code> table, which also stores their <code>sex</code>.</p>
  
  <p>We would want to show each user the users that viewed them <strong>in order of most recent view to oldest view</strong>.</p>
  
  <p>We would obviously not want to show the user themselves if they happened to view their own profile.</p>
  
  <p>We would want to show guys only the girls that viewed them, and the girls only the guys that viewed them.</p>
  
  <ol>
  <li>How would we setup the <strong>table</strong> of <code>ProfileViews</code> to do that? </li>
  <li>What <strong>indexes</strong> would we use?</li>
  <li>What would be the <strong>query</strong> we would need to show each user who has viewed them?</li>
  </ol>