We have a database that holds weekly employee shift information. There are up to 7 (daily) shifts for each job function.
Each employee shift is a different record - example fields: (user_id, user_name, date, start_time, end_time, header_id) etc.
Each week therefore consists of several records, grouped by a header record.
We add / delete shifts using ADDT with individual transactions, displayed with a do-while loop.
This works well as we can fine tune each shift as required. See screen grab:
NB: We don't use the Nextensio dynamic multiple row forms as these conflict with other parts of the site, making it unreliable.
Now, to set up next week,we want to be able to copy all the shifts from this week to next week as one action. We can get all the shift information, using recordsets and repeat regions, but I am stuck on the multiple insert transaction.
Is it possible to do this with the Custom Form Wizard? Or how else might this be done?
We use the PHP / MySQL model.
Any help much appreciated.
Michael
Insert multiple rows in database
Re: Insert multiple rows in database
Micheal you probably better of doing it manually.
Create a new page and apply the usual security measures
Then use
Then redirect somewhere.
Create a new page and apply the usual security measures
Then use
Code: Select all
mysql_query("INSERT INTO 'target_table' (column1, column2) (SELECT (column1, column2) FROM 'source_table' WHERE something = something"));
Re: Insert multiple rows in database
Thanks Fred, I'll have a look at this.