thkalam wrote:i have created 3 tables 1 schools 1 facilities and 1 with 2 ids from the first 2 tables.
The problem is that i just know how to fill one row on mysql eg school1 and facility 1 where i can find code to fill school1 facility1 & school1 facility 2 with the same code?
I can't really understand you. There are 3 tasks:
- Enter data for schools
- Enter data for facilities
- Enter linking data for the 3rd table
The first 2 tasks are the most basic tasks that absolutely every database project requires, so I assume that you know how to do that, or if not, you will learn that from a beginner's tutorial. How you accomplish the 3rd task depends on whether you just need to do it once, for a reasonably small number of schools/facilities, or whether this is an ongoing requirement and you need to have an interactive form-based method. If it is the latter, the simplest way is to have a form with two drop-down selection boxes, one for schools and one for facilities, and a submit button that can be clicked to form a relationship. The user selects a school, then selects a facility, then clicks on the submit button, which submits the form to a script that inserts a new record in the 3rd table, with the id values of the school and the facility, which would be the values in the <option> tags of the selected choices in the form.