Skip to main content
Known Participant
July 13, 2009
Question

Insert checked search results into a new table

  • July 13, 2009
  • 1 reply
  • 1373 views

I've built a search/results page in PHP that returns the names and contact information of people stored in a MySQL database. I've configured the Repeat Region so that there is a checkbox included in each result "cell." I'd like to make it so that a user can check the results he wants, press Submit, and have information from each selected result inserted into a different table as a unique record. How would I do this?

Thanks,

Gabe

This topic has been closed for replies.

1 reply

Known Participant
July 14, 2009

Any ideas?

DwFAQ
Participating Frequently
July 14, 2009

I think you already said how to do it. Create a form with a checkbox out of your query results wrapped in a repeated region. In checkbox value of repeated region enter dynamic value of query results. Then submit form to insert record script which is located in your form "action".

July 17, 2009

I did what you suggested and inserted a dynamic value. I arbitrarily chose 'agentid', but it ended up producing the same results that I started with. Maybe I should try explaining what I'm trying to do a bit better: I have a search form on the page that a user can use to search one table. Each result has a checkbox next to it. The user could then hit a submit button, and only the records that he checked would be uploaded to a different table. My problem is that the check function doesn't seem to work: for some reason, no matter which box gets checked--even if no boxes are checked--the last search result gets uploaded to the second table when I hit submit. I'm not sure why that keeps happening.


So I guess u are trying to insert multiple records in second table. What's the values u want to store in that second table? I think the the first variable(except the primary key of 2nd table) is the agentid.