i wish to capture user input regarding workhistory on one form - how do I catch the same infor structure, ie. company name, position, duration, job description, for 3-4 companies, dynamically in PHP and write it to mySQL. I need direction on how to do this re...form structure and table structure, if its not too much to ask.
You could have a js-triggered 'add another company' feature for your form, which would add another 'row' to your form.
<form method="post" action="..."> <div class="row"> <label>Company:</label> <input name="company"> <label>Position:</label> <input name="position"> <label>From-To:</label> <input name="from_to"> <label>Description:</label> <textarea name="description"></textarea> </div> <button id="addrow">Add Company</button> <button type="submit" name="submit">Submit</button> </form>
Anyway, that's just an idea.
The MySQL tables, should be pretty straightforward
A general user table (assume PK is user_id)
A user_companies table...
uc_id (PK/autoincrement integer) user_id (FK) company [varchar 30?] position [varchar 30?] duration [varchar20?] description [text]
This is not meant as a complete solution, just something to think about with regard to getting started. The form could be hard coded with say 4 rows as opposed to being interactive with js. Up to you.