# CF: Inserting multiple records in Database table

**URL:** <https://forum.kirupa.com/t/cf-inserting-multiple-records-in-database-table/206561>\
**Category:** web dev\
**Created:** [November 9, 2006, 10:15am UTC](https://forum.kirupa.com/t/cf-inserting-multiple-records-in-database-table/206561 "2006-11-09T10:15:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![estateboy](https://avatars.discourse-cdn.com/v4/letter/e/958977/32.png) [@estateboy](https://forum.kirupa.com/u/estateboy)\
**Post date:** [November 9, 2006, 10:15am UTC](https://forum.kirupa.com/t/cf-inserting-multiple-records-in-database-table/206561/1 "2006-11-09T10:15:18Z")

</div>

Hi everybody,

I’m making a guestbook in Dreamweaver/Coldfusion! But I want to see the messages first before I want to show them in the guestbook online. So I made a second page called guestbookAdmin.cfm (table guestbookAdmin) where the messages temporary will be stored untill I aprove or delete them The database has two identical tables named guestbook and guestbookAdmin both with the following table rows:  
GB\_ID  
GB\_Date  
GB\_Name  
GB\_Message

With repeat region guestbookAdmin.cfm shows 10 records. Next to every record I would like to have 2 check boxes. One to delete the ckecked message from the table guestbookAdmin (In case I don’t want to show that message on-line) and one to insert the message into the table guestbook (When I approve the message). I have found a solution to delete multiple records with checkboxes:  
Every record has a checkbox included checkbox name “DEL\_#GB\_ID#” and than I added the following \<cfif\>:

```auto
</CFIF>
<cfif IsDefined('FORM.FieldNames')>
<cfloop index="i" list="#FORM.FieldNames#" DELIMITERS="," >
<cfif LEFT(i, 4) IS "DEL_" >
<CFSET selectGBID = RemoveChars(i, 1, 4)>
<CFSET selectGBID = #Evaluate(selectGBID)#>
</cfif>

```

This works great, but I can’t figure out to get the same results for inserting multiple records. Does somebody have an idea. I would be very thankful.
