This is my first appearance on a forum ever, I am fairly new at programming and I have following question :
If I make a INSERT...SELECT statement (to transfer data from one table to another) in a MySQL-editor, the statement gets executed once ; the same statement in my PHP-script gets executed twice. Anyone a idea how this is possible ?
^<?php require_once('../includes/verbinding.php'); $id = $_GET['id']; $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); echo mysqli_error($dbc); $query = "INSERT INTO Coach (CoachVoornaam, CoachFamnaam, CoachAdresnummer, CoachPostcode, CoachWoonplaats, CoachProvincie) select TMPCoachVoornaam as CoachVoornaam, TMPCoachFamnaam as CoachFamnaam, TMPCoachAdresnummer as CoachAdresnummer, TMPCoachPostcode as CoachPostcode, TMPCoachWoonplaats as CoachWoonplaats, TMPCoachProvincie as CoachProvincie FROM TMPCoach where TMPCoachID='" . $id ."'"; mysqli_query($dbc, $query); echo mysqli_error($dbc); mysqli_close($dbc); echo 'einde php-script'; ?>