the following commands work if I run them directly in phpmyadmin as SQL
CREATE TEMPORARY TABLE tmptable_1 SELECT * FROM De_Lijst WHERE Nieuw = "Ja";
UPDATE tmptable_1 SET DB_ID = NULL, Nieuw = "", Positie =0, Datum_Af = CURRENT_DATE;
INSERT INTO De_Lijst SELECT * FROM tmptable_1;
DROP TEMPORARY TABLE IF EXISTS tmptable_1;
update De_Lijst set Info =if(Nieuw ="Ja","",Info);
update De_Lijst set Datum_Af =if(Nieuw ="Ja","",Datum_Af);
update De_Lijst set Datum_Op =if(Nieuw ="Ja","",Datum_Op);
update De_Lijst set Titel =if(Nieuw ="Ja","",Titel);
update De_Lijst set Artiest =if(Nieuw ="Ja","",Artiest);
update De_Lijst set Nieuw =if(Nieuw ="Ja","",Nieuw);
update De_Lijst set Nieuw =if(Nieuw ="Nieuw","",Nieuw);
I created a page called reset.php that looks this
<?php
require 'database.php';
$pdo = Database::connect();
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = 'update De_Lijst set Info =if(Nieuw ="Ja","nee",Info)';
$q = $pdo->prepare($sql);
$q->execute(array($Nieuw,$Positie,$Artiest,$Titel,$Info,$Datum_Op,$Datum_Af)); Database::disconnect();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="./bootstrap-4.0.0/dist /css/bootstrap.min.css">
<link rel="stylesheet" href="./css/custom.css">
<script src="./bootstrap-4.0.0/dist/js/bootstrap.bundle.min.js"> </script>
</head>
<body>
Hello<br>
<form method="POST" action="reset.php">
<input type="submit" name="reset" value="reset"/>
</form>
</body>
</html>
The php file is just a test with one query but I need all the sql inserts. but results in a 500 error. Any info on what I am doing wrong?
Thanks, Jacques