<?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <link rel="stylesheet" type="text/css" href="/css/table.css"> <link rel="stylesheet" type="text/css" href="/css/style.css"> <title>Delete ID</title> </head> <body> <?php //Debug //echo 'Session: ' . session_id() . ' Count: ' . $_SESSION['counter'] . '<br>'; //var_dump($_SESSION); ?> <pre> <?php include('/home/kb0iic/config.inc'); if (!empty($_POST['delid'])) { $delid = isset($_POST['delid']) ? $delid = $_POST['delid'] : null; $nc = count($delid); for ($i=0;$i<$nc;$i++) { $did = $delid[$i]; echo "Removing $did\n"; $sql = 'DELETE PKG, PKG_CFG, PKG_BLD, PKG_NST, PKG_SET, PKG_NOT, PKG_URL FROM PKG, PKG_CFG, PKG_BLD, PKG_NST, PKG_SET, PKG_NOT, PKG_URL WHERE PKG_CFG.pkg_id = PKG.id AND PKG_BLD.pkg_id = PKG.id AND PKG_NST.pkg_id = PKG.id AND PKG_SET.pkg_id = PKG.id AND PKG_NOT.pkg_id = PKG.id AND PKG_URL.pkg_id = PKG.id AND PKG.id=:id ;'; try { $stmt = $pdo->prepare($sql); $stmt->execute(['id' => $did]); } catch (PDOException $e) { echo '<font color="D00"><pre>Have a big problem</pre></font>'; throw $e; } } } else { echo "No rows selected to delete!"; } ?> </pre> <form action="list.php" method="POST"> <input type="submit" name="select" value="OK"> </form> </body> </html>