title: Auto primary key insert custom table $wpdb
body: <p>I need to insert to custom table that has primary key 'id' by number, but I got this problem for example </p>
  
  <p>I have 5605 rows (start with id = 1) in my table,so I have to set current id = 5606 to insert. </p>
  
  <p>1/I set $data['id'] = 5606 by hand to insert it, it works fine. current row with id 5606 is inserted.</p>
  
  <p>but I want it automatically get the right id to insert so I do</p>
  
  <p>2/select * to returns the current number of rows in table, it returns 5604 (always lesser by 1 when I check database has 5605). so I + 2 then do insert.
  It ends up insert 3 times like 5606 5607 5608 in my table.
  Please help me here is my code</p>
  
  <pre><code> $data = array(
    'name' =&gt; 'naomi',
    'ability'  =&gt; 'walk',
   );
  
   $wpdb-&gt;get_results("SELECT *  FROM contest");
   $numid = $wpdb-&gt;num_rows; 
   $numid +=2;
   $data['id'] = $numid;
   $wpdb-&gt;insert('contest', $data);
  </code></pre>
  
  <p>The given number is for example, my problem is in that format.</p>