Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $sql = "INSERT INTO groep (groepid, code, naam, actief) VALUES (?,?,?,?)
- ON DUPLICATE KEY UPDATE
- id=LAST_INSERT_ID(id),
- groepid = VALUES(groepid),
- code = VALUES(code),
- naam = VALUES(naam),
- actief = VALUES(actief)";
- $statement = $this->connectie->prepare($sql);
- if ($statement) {
- $statement->bind_param('issi', $groepid, $code, $naam, $actief);
- $statement->execute();
- return $statement->insert_id;
- }
- return -1;
- example qry:
- INSERT INTO groep (groepid, code, naam, actief) VALUES (NULL,'SPG','Lekker spelen',1) ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id), groepid = VALUES(groepid), code = VALUES(code), naam = VALUES(naam), actief = VALUES(actief)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement