Forum Moderators: coopster

Message Too Old, No Replies

Copying data from one table to other using selected value on checkbox

         

NoobLike

6:18 am on Jun 15, 2012 (gmt 0)

10+ Year Member



Need some code help here because I'm beginner on web development in PHP :)


Thanks and Best Regards,
NoobLike

rocknbil

4:12 pm on Jun 15, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard Nooblike, we're going to need a little more info than that. :-)

- Database structure - a rough example of the two tables.
- Form example - don't code dump the whole page, cut it down to the bare minimum of the area in question.
- Code example - don't code dump the whole script, just the relevant parts of how far you've gotten so far.
- Actual task: define what you want to do a little more specifically. Whole table? One row? Select fields? Why do you need to do this?

There may be a more efficient way rather than maintaining the same data in two tables. One example: a customer creates a cart but hasn't checked out. If you intend to copy the order from a temporary cart data table to a completed orders table, you can use a single table with a field for order status and just change the order status to a number representing complete.

NoobLike

3:31 am on Jun 16, 2012 (gmt 0)

10+ Year Member



For example i have 2 tables, table1 and table2. When i check the check-box those only selected item will be copied or transfer to table2

coopster

11:34 pm on Jun 18, 2012 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



The basic approach is to locate the unique identifier that will allow you to select that row from table1 and then write an SQL query to select and insert the values for that unique identifier into table2.

NoobLike

2:08 am on Jun 19, 2012 (gmt 0)

10+ Year Member



Thank you Coopster..i got it :)