title: Java - Seat Reservation system
body: <p>I need to create a reservation system that will reserved seats for one or many passenger
  If for example the passenger reserved for three seats how can I make the three of those reserved seats be inserted into one auto incrementing id in my database?</p>
  
  <p>For example if passenger reserve for three seats, in my database it should look like:</p>
  
  <pre><code>Ticket Number   Passenger Name        
  2               passenger1
  2               passenger2
  2               passenger3
  </code></pre>
  
  <p>This is what I'm using now:</p>
  
  <pre><code>sql1 = "INSERT INTO  passenger_details(fname,lname,gender,address,cc_no,bank_name,no_of_tickets,seat,destination)  
  VALUES('"+fnm+"','"+lnm+"','"+gnd+"','"+add+"','"+cc+"','"+bank+"','"+tckts+"','"+seats+"','"+dest+"')
  ('"+fnm+"','"+lnm+"','"+gnd+"','"+add+"','"+cc+"','"+bank+"','"+tckts+"','"+seats2+"','"+dest+"'), 
  ('"+fnm+"','"+lnm+"','"+gnd+"','"+add+"','"+cc+"','"+bank+"','"+tckts+"','"+seats3+"','"+dest+"')";
  </code></pre>