Skip to content
This repository has been archived by the owner on Oct 22, 2018. It is now read-only.

Update- en insertquery 'Rol' werkt niet #5

Open
YavuzzzSelimmm opened this issue Jul 1, 2014 · 0 comments
Open

Update- en insertquery 'Rol' werkt niet #5

YavuzzzSelimmm opened this issue Jul 1, 2014 · 0 comments

Comments

@YavuzzzSelimmm
Copy link
Owner

De update- en insertquery van 'Rol' in het Admin-gedeelte werkt niet helemaal. Zie /content/admin/edit.php.

Regel 383 t/m 401:

/* UPDATEQUERY WERKT NIET
    Updaten van 'Subsitenaam' lukt niet.
    Updaten van Rolafkorting en Rolomschrinving lukt wel.
*/
    // if everything is fine, update the record in the database  
    // Update Rolafkorting + Rolomschrijving
    if ($stmt = $mysqli->prepare("UPDATE Rol R 
                                  SET   Afkorting = ?
                                      , Omschrijving = ?
                                  WHERE PK_Rol=?"))
    {
        $stmt->bind_param("ssi", $Rolafkorting, $Rolomschrijving, $PK);
        $stmt->execute();
        $stmt->close();
    }

    // Update FK_Subsite
    if ($stmt= $mysqli->prepare("UPDATE Rol R 
                                 LEFT JOIN Subsite S 
                                    ON R.FK_Subsite = S.PK_Subsite
                                 SET R.FK_Subsite = S.PK_Subsite
                                 WHERE S.Naam = ? 
                                       AND R.PK_Rol=?"))
    {
        $stmt->bind_param("si", $Subsitenaam, $PK);
        $stmt->execute();
        $stmt->close();
    }
/* UPDATEQUERY WERKT NIET */

Regel 471 t/m 481:

/* INSERTQUERY WERKT NIET
    Bij het inserten van het veld 'Subsitenaam' moet de bijbehorende PK_Subsite uit de tabel 'Subsite' gezocht worden.
    In de tabel 'Rol' wordt deze waarde opgeslagen in de column 'FK_Subsite'.
*/
    // insert the new record into the database
    if ($stmt = $mysqli->prepare("INSERT Rol ()
                                  VALUES (? ? ?)")) {
        $stmt->bind_param("sss", $Subsitenaam, $Rolafkorting, $Rolomschrijving);
        $stmt->execute();
        $stmt->close();
    }
/* INSERTQUERY WEKRT NIET */
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant