Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8102183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:10:49+00:00 2026-06-05T23:10:49+00:00

I’m breaking my head over this code: <html> <head> <title>Westpop</title> <link rel=stylesheet href=opmaak.css> </head>

  • 0

I’m breaking my head over this code:

<html>
<head>
  <title>Westpop</title>
  <link rel="stylesheet" href="opmaak.css">
</head>
<body>
<div id="header"><a href="Index.php"></a></div>

<div id="content">
<table cellpadding="5" align="center">
<th colspan="2" align="left">Registeren:</th>
<form name="registreren"  method="post" action="registratie.php">
<tr>
    <td>Email</td>
    <td><input type="text" size="50" placeholder="email@email.com" name="email"></td>
</tr>
<tr>
    <td>Voornaam</td>
    <td><input type="text" size="50" placeholder="" name="voornaam" ></td>
</tr>
<tr>
    <td>Achternaam</td>
    <td><input type="text" size="50" placeholder="" name="achternaam"></td>
</tr>
<tr>
    <td>Geboorte Datum</td>
    <td><input type="text" size="50" placeholder="dd-mm-jjjj" name="geboortedatum"></td>
</tr>
<tr>
    <td>Geslacht</td>
    <td>M<input type="radio" size="50" value="m" name="geslacht">
    V<input type="radio" size="50" value="v" name="geslacht"></td>

</tr>
<tr>
    <td>Wachtwoord</td>
    <td><input type="password" size="50" placeholder="min. 6 tekens" name="wachtwoord"></td>
</tr>
<tr>
    <td>Woonplaats</td>
    <td><input type="text" size="50" placeholder="" name=""></td>
</tr>
<tr>
    <td>Telefoonnummer</td>
    <td><input type="text" size="50" placeholder="min. 9 tekens" name="telefoonnummer"></td>
</tr>
<tr>
    <td>Functie</td>
    <td><select name="functie">
<option value="catering">Catering</option>
<option value="muziekpodia">Muziek en podia</option>
<option value="vervoerovernachten">Vervoer en overnachten</option>
<option value="logistiekbeveiliging">Logistiek en beveiliging</option>
<option value="diversen">Diversen</option>
</select></td>
</tr>
<tr align="right">
    <td></td>
    <td><input type="reset" value="Wissen"><input type="submit" name="verzenden" value="Verzenden"></td>
</tr>
</form>
</table>
</div>

 <?php 

    $host = "localhost";
    $gebruikersnaam = "root";
    $wachtwoord = "";
    mysql_connect($host, $gebruikersnaam, $wachtwoord);

    $demooistedatabase = "c5g4westpopintranet";
    mysql_select_db($demooistedatabase);


    $achternaam = $_POST["achternaam"];
    $voornaam = $_POST["voornaam"];
    $gbdatum = $_POST["geboortedatum"];
    $email = $_POST["email"];
    $geslacht = $_POST["geslacht"];
    $wachtwoord = $_POST["wachtwoord"];
    $woonplaats = $_POST["woonplaats"];
    $telefoonnummer = $_POST["telefoonnummer"];
    $functie = $_POST["functie"];

    mysql_query($query); 

    $query ="   INSERT INTO vrijwilliger (vrijwilligerID, voornaam, achternaam, gbdatum, geslacht, wachtwoord, woonplaats, adres, telefoonnummer, functie, activiteitID, groepID, email)
                VALUES( ,'".$voornaam."','".$achternaam."','".$gbdatum."','".$geslacht."','".$wachtwoord."','".$woonplaats."','".$adres."','".$telefoonnummer."','".$functie."','','','".$email."');";


    echo mysql_error();
?>
<?php
include ("html_end.php");
?>

Been trying for hours, but he just doesn’t want to insert in the database.
I think it’s something with the SQL query, but i can’t see it.
There is not much else to say

EDIT 1:

Thanks for all the answers! I now edited the code like this:

 $query ="   INSERT INTO vrijwilliger (vrijwilligerID,voornaam, achternaam, gbdatum, geslacht, wachtwoord, woonplaats, adres, telefoonnummer, functie, activiteitID, groepID, email)
                        VALUES(NULL, '".$voornaam."','".$achternaam."','".$gbdatum."','".$geslacht."','".$wachtwoord."','".$woonplaats."','".$adres."','".$telefoonnummer."','".$functie."','','','".$email."');";

mysql_query($query) or die ("FOUT: ". mysql_error());

And now i’m getting the error:
Cannot add or update a child row: a foreign key constraint fails (c5g4westpopintranet/vrijwilliger, CONSTRAINT vrijwilliger_ibfk_1 FOREIGN KEY (activiteitID) REFERENCES activiteit (activiteitID))

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T23:10:50+00:00Added an answer on June 5, 2026 at 11:10 pm

    I believe vrijwilligerID is set to AUTO_INCREMENT.

    Hence, Instead of

        mysql_query($query); 
    
        $query ="   INSERT INTO vrijwilliger (vrijwilligerID, voornaam, achternaam, gbdatum, geslacht, wachtwoord, woonplaats, adres, telefoonnummer, functie, activiteitID, groepID, email)
                    VALUES( ,'".$voornaam."','".$achternaam."','".$gbdatum."','".$geslacht."','".$wachtwoord."','".$woonplaats."','".$adres."','".$telefoonnummer."','".$functie."','','','".$email."');";
    

    Use this

    $query ="INSERT INTO vrijwilliger (voornaam, achternaam, gbdatum, geslacht, wachtwoord, woonplaats, adres, telefoonnummer, functie, activiteitID, groepID, email)
             VALUES('$voornaam','$achternaam','$gbdatum','$geslacht','$wachtwoord','$woonplaats','$adres','$telefoonnummer','$functie',null,null,'$email')";
    mysql_query($query); 
    

    Please try this and let me know if you are facing any problem.

    Update 1

    For edit 1 : You are getting this error as you are setting activiteitID=null which is not acceptable as null is not any ID present in table activiteit

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
i got an object with contents of html markup in it, for example: string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.