title: Setting up a MySQL table to track user link clicks
body: <p>This is a followup to a question I posted a few days ago.</p>
  
  <p>basically, I have a site with six links. In order to access the site, users must log in using LDAP authentication. When they do this, I grab some of their account credentials (username, firstname, lastname), and store it in a PHP $_SESSION variable. </p>
  
  <p>That works; the user can log in, and the session data is being stored successfully.</p>
  
  <p>Now, I want to set up a way to track which links have been clicked by what users. Basically just store a time stamp in the database of when they clicked the link. I want to be able to see who has (or has not) clicked each link, and when.</p>
  
  <p>Can I do this in a single table / would that be a bad idea? I was thinking setting up the table like this:</p>
  
  <p>TABLE (each bullet indicative of a column)</p>
  
  <ul>
  <li>auto-incrementing ID</li>
  <li>user account name: abc1234</li>
  <li>user account first name: John</li>
  <li>link 1: Last Accessed 5/2/2012 at 4:15PM</li>
  <li>link 2: NULL</li>
  <li>link 3: NULL</li>
  <li>link 4: Last Accessed 5/1/2012 at 2:20PM</li>
  <li>link 5: NULL</li>
  <li>link 6: NULL</li>
  </ul>
  
  <p>basically the above would say that "John" had only clicked the first and 4th links. The rest are null because he has never accessed them. If he were to click #1 again, it would overwrite with the more recent date/time.</p>
  
  <p>Can I do this in a single table? or will that create complications? I feel like the thing I will have the hardest time with is checking to see if the user is already in the database before adding the info (ie so that if John logs in a second time, a whole new row isn't created for him)</p>
  
  <p>Thanks for any help!</p>