title: how can I INSERT a random Point with X|Y which is not yet in my Mysql Database
body: <p>Yeah.</p>
  
  <p>I have some bases in coordinates. they are all around the center. Now I want to add one more base, at unique coordinates, near the other bases. I have thought about that so far:</p>
  
  <pre><code>INSERT INTO `mydb`.`base`
      (`idbase`, `coordinate_X`, `coordinate_Y`)
      VALUES (NULL,
              '(FLOOR( 1 + RAND( ) *((select max(coordinate_X))+1)))',
              '(FLOOR( 1 + RAND( ) *((select max(coordinate_Y))+1)))'
             );
  </code></pre>
  
  <p>idbase is autoincrement, thats why I insert NULL</p>
  
  <p>This so far is how I could choose a point in the area I want them to have. I allready thought of making an unique index with the coordinates. But how can I go sure, that a new base is created at a new point?</p>
  
  <p>I would prefer not doing it with a while-loop in php, i think that wouldnt be a nice sollution.</p>
  
  <p>EDIT:</p>
  
  <p>that did not even work, i cant make a subselect in that insert statement..</p>