title: Generating unique account numbers - recursive call
body: <p>Hi i need to generate 9 digit unique account numbers. Here is my pseudocode:</p>
  
  <pre><code>function generateAccNo()
  
      generate an account number between 100,000,000 and 999,999,999
  
      if the account number already exists in the DB 
          call generateAccNo()    /* recursive call */
      else
          return new accout number
      end if
  
  end function
  </code></pre>
  
  <p>The function seems to be working well, however I am a bit worried about the recursive call. </p>
  
  <p>Will this cause any memory leaks (PHP 5 under apache)?</p>
  
  <p>Is this an acceptable way to tackle this problem?</p>
  
  <p>Thanks for your input.</p>