Expected duration: 1 day or less Firstly I am currently building a system for a client which is a MySQL Database with a Web-Based UI. I have two tables one of which is the master table and one of which is a child table. The Master Table has a Primary Key of goodsin_id and the Child Table has a foreign key of goodsin_id. The child table will record individual packages against a single order. The single order details being placed in the master table. So a "One to Many relationships" I use a tool called PHPRunner the manual for which is found here https://xlinesoft.com/phprunner/docs/ . In order to place the Primary Key into the Foreign Key when adding new lots to order, I run have the following code placed in a "Before Record Added Event" in the Child Table. (you can see these in the manual and how they are used).
This is fine and populates the foreign key fine. I have also attached a screenshot of how this code is deployed in the tool and an example of what I need on a representative of the Child Table.
What I need is a snippet of code that will facilitate the numbering of the lot_id column as and when lots are entered against each order number. When I put posting in a PHPRunner Forum I got this reply.
"You will need to write a piece of PHP code snippet that would go through all items of a certain order and renumber them according to some rules. This piece of code will need to run after a new item was added or deleted so events AfterAdd and AfterDelete is where it needs to be added."
Please let me know if you can do it and how long it would take. Please don't rush, make sure you understand it. Please no one-line proposals please detail your ability to solve.
Please state how long the work will actually take. Thank you.