title: How to make a unique username when using FB connect
body: <p>Hi everyone I want make sure the username is unique! </p>
  
  <p>First I get there username and check if existing already. If not add them to the database, but if the username is taken I will add number behind it.</p>
  
  <p>Example: <code>JoshSmith, JoshSmith1</code></p>
  
  <p>If there is no username the user still use the <code>id</code> version. I will get there first and last name. And then repeat the above steps.</p>
  
  <p>The problem: If <code>JoshSmith</code> is taken I will add number behind it, but if <code>JoshSmith1</code> is also taken.</p>
  
  <p>If I use</p>
  
  <pre><code>SELECT count(*) FROM users WHERE username LIKE '%JoshSmith%'
  </code></pre>
  
  <p>it will return names like <code>JoshSmithing</code> and this is wrong. If I use </p>
  
  <pre><code>MATCH () AGAINST ()
  </code></pre>
  
  <p>returns the same results.</p>
  
  <p>First I thought to count how many times the username exist and add the number+1</p>
  
  <pre><code>JoshSmith14
  </code></pre>
  
  <p>But that will be wrong.</p>