title: Delete sql table data then insert multiple variable amount of rows
body: <p>Could anyone help please?
  trying to create a page for calendar entries for a band that they can update themselves on their own site.</p>
  
  <p>html entry page:</p>
  
  <pre><code>&lt;form action="addgigtimes.php" method="POST"&gt;
  &lt;fieldset class='multi'&gt;
  &lt;legend&gt;&lt;h5&gt;Gig 1&lt;/h5&gt;&lt;/legend&gt;
  
  &lt;label for='weekday' class='accessAid'&gt;&lt;/label&gt;
  &lt;select id='weekday' name='weekday'&gt;
  &lt;option value='' selected&gt;Day of week&lt;/option&gt;
  &lt;option value='Monday'&gt;Monday&lt;/option&gt;
  &lt;option value='Tuesday'&gt;Tuesday&lt;/option&gt;
  &lt;option value='Wednesday'&gt;Wednesday&lt;/option&gt;
  &lt;option value='Thursday'&gt;Thursday&lt;/option&gt;
  &lt;option value='Friday'&gt;Friday&lt;/option&gt;
  &lt;option value='Saturday'&gt;Saturday&lt;/option&gt;
  &lt;option value='Sunday'&gt;Sunday&lt;/option&gt;&lt;/select&gt;
  
  
  
  &lt;label for='day' class='accessAid'&gt;&lt;/label&gt;
  &lt;select id='day' name='day'&gt;&lt;option value='' selected&gt;--Day--&lt;/option&gt;
  &lt;option value='01'&gt;01&lt;/option&gt;
  &lt;option value='02'&gt;02&lt;/option&gt;
  &lt;option value='03'&gt;03&lt;/option&gt;
  &lt;option value='04'&gt;04&lt;/option&gt;
  &lt;option value='05'&gt;05&lt;/option&gt;
  &lt;option value='06'&gt;06&lt;/option&gt;
  &lt;option value='07'&gt;07&lt;/option&gt;
  &lt;option value='08'&gt;08&lt;/option&gt;
  &lt;option value='09'&gt;09&lt;/option&gt;
  &lt;option value='10'&gt;10&lt;/option&gt;
  &lt;option value='11'&gt;11&lt;/option&gt;
    &lt;option value='12'&gt;12&lt;/option&gt;
  &lt;option value='13'&gt;13&lt;/option&gt;
  &lt;option value='14'&gt;14&lt;/option&gt;
  &lt;option value='15'&gt;15&lt;/option&gt;
  &lt;option value='16'&gt;16&lt;/option&gt;
  &lt;option value='17'&gt;17&lt;/option&gt;
  &lt;option value='18'&gt;18&lt;/option&gt;
  &lt;option value='19'&gt;19&lt;/option&gt;
  &lt;option value='20'&gt;20&lt;/option&gt;
  &lt;option value='21'&gt;21&lt;/option&gt;
  &lt;option value='22'&gt;22&lt;/option&gt;
  &lt;option value='23'&gt;23&lt;/option&gt;
  &lt;option value='24'&gt;24&lt;/option&gt;
  &lt;option value='25'&gt;25&lt;/option&gt;
  &lt;option value='26'&gt;26&lt;/option&gt;
  &lt;option value='27'&gt;27&lt;/option&gt;
  &lt;option value='28'&gt;28&lt;/option&gt;
  &lt;option value='29'&gt;29&lt;/option&gt;
  &lt;option value='30'&gt;30&lt;/option&gt;
  &lt;option value='31'&gt;31&lt;/option&gt;&lt;/select&gt;
  
  &lt;label for='month' class='accessAid'&gt;&lt;/label&gt;
  &lt;select id='month' name='month'&gt;&lt;option value='' selected&gt;--Month--&lt;/option&gt;
  &lt;option value='01'&gt;01 (Jan)&lt;/option&gt;
  &lt;option value='02'&gt;02 (Feb)&lt;/option&gt;
  &lt;option value='03'&gt;03 (Mar)&lt;/option&gt;
  &lt;option value='04'&gt;04 (Apr)&lt;/option&gt;
  &lt;option value='05'&gt;05 (May)&lt;/option&gt;
  &lt;option value='06'&gt;06 (Jun)&lt;/option&gt;
  &lt;option value='07'&gt;07 (Jul)&lt;/option&gt;
  &lt;option value='08'&gt;08 (Aug)&lt;/option&gt;
  &lt;option value='09'&gt;09 (Sep)&lt;/option&gt;
  &lt;option value='10'&gt;10 (Oct)&lt;/option&gt;
  &lt;option value='11'&gt;11 (Nov)&lt;/option&gt;
  &lt;option value='12'&gt;12 (Dec)&lt;/option&gt;&lt;/select&gt;
  
  &lt;label for='year' class='accessAid'&gt;&lt;/label&gt;&lt;select id='year' name='year'&gt;
  &lt;option value='' selected&gt;--Year--&lt;/option&gt;
   &lt;option value='2015'&gt;2015&lt;/option&gt;
  &lt;option value='2016'&gt;2016&lt;/option&gt;
  &lt;/select&gt;    
   venue
  &lt;input type="text" class="input"  name="venue" /&gt;
  location
  &lt;input type="text" class="input"  name="location" /&gt;
  time
  &lt;input type="text" class="input"  name="time" /&gt;
  &lt;/fieldset&gt;
  
  &lt;button type="reset" style="border: 0; background: transparent"&gt; 
  &lt;img src="images/reset.jpg"  alt="reset" style="margin-right:19px "/&gt; 
  &lt;/button&gt;
  &lt;button type="submit" value="submit" style="border: 0; background:transparent"&gt; 
  &lt;img src="images/submit.jpg"  alt="submit" /&gt; 
  &lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I will repeat the fieldset code 30 times so the band can enter a max of 30 gigs at once. </p>
  
  <p>here is the php code:</p>
  
  <pre><code>$sql = "DELETE FROM gigtimes";
  
  $weekday = $_POST['weekday'];
  $day = $_POST['day'];
  $month = $_POST['month'];
  $year = $_POST['year'];
  $venue = $_POST['venue'];
  $location = $_POST['location'];
  $time = $_POST['time'];
  
  
  $rt=mysql_query("insert into guestbook(weekday,day,month,year,venue,location,time) VALUES      ('$weekday','$day','$month','$year','$venue','$location','$time')");
  echo mysql_error();
  </code></pre>
  
  <p>So basically delete whats already on the database then update.
  I'm just not sure how to go about the row ids? Could anyone explain.
  Thanks,
  Bettsy</p>