artisy2014
Nieuwe gebruiker
- Lid geworden
- 24 dec 2014
- Berichten
- 1
1 What I want:
• Let users create a news item using a form
• The news item must be connected to a tournament.
2 Database tables
Table Toernooien (Toernooi_id, Naam_Toernooi)
Table Nieuws (Nieuws_id, Nieuwstitel, Nieuwsbericht, Publicatiedatum, Toernooi_id)
3 My form

4 validating the form and inserting data to database
Most of this part is not a problem.
But I can't figure 1 thing out:
- How can I set the Tournament_id (Toernooi_id) for a news item?
In the form I want the user to select the Tournament by name(from table one) which works.
But then I need something to convert the selected Tournament into the related Tournament_id. and the Tournament_id that belongs to the new item has to be inserted into the News table.
• Let users create a news item using a form
• The news item must be connected to a tournament.
2 Database tables
Table Toernooien (Toernooi_id, Naam_Toernooi)
Table Nieuws (Nieuws_id, Nieuwstitel, Nieuwsbericht, Publicatiedatum, Toernooi_id)
3 My form

4 validating the form and inserting data to database
Most of this part is not a problem.
But I can't figure 1 thing out:
- How can I set the Tournament_id (Toernooi_id) for a news item?
In the form I want the user to select the Tournament by name(from table one) which works.
But then I need something to convert the selected Tournament into the related Tournament_id. and the Tournament_id that belongs to the new item has to be inserted into the News table.