title: Creating dynamic auto-incrementing seo friendly url's from php and sql
body: <p>Clicking on user John Smith in position    <strong>user_id</strong> 1 It should go to the url www.example.com/John-Smith as opposed to profile.php?uid=1</p>
  
  <p>When you click on user John Smith in <strong>user_id</strong> 2 It should go to the url www.example.com/John-Smith-2
  profile.php?uid=2</p>
  
  <p>When you click on user Kia Dull in <strong>user_id</strong> 3 It should go to the url www.example.com/Kia-Dull
  profile.php?uid=3</p>
  
  <pre><code>Table Users
  
  User_id    First_name    last_name
     1          John         Smith
     2          John         Smith
     3          Kia          Dull
  </code></pre>
  
  <p>How do I format my .Htaccess file and php/sql for this. </p>
  
  <p>When a user profile is clicked I just simply lead it here.</p>
  
  <pre><code>&lt;a href="&lt;?php echo $row[first_name] ?&gt;-&lt;?php echo $row[last_name] ?&gt;"
  </code></pre>
  
  <p>which doesn't do anything.</p>
  
  <p>and here's my .htaccess</p>
  
  <pre><code>RewriteEngine on
  RewriteBase /
  RewriteRule ^(.*)$ profile.php?uid=$1 [L]
  </code></pre>