prepare('DELETE FROM path WHERE id = ?'); $stmt->execute(array($_POST['delete'])); $msg = 'Path deleted'; } if (isset($_POST['add'])) { if (!realpath($_POST['path']) || empty($_POST['path'])) { $msg = "Invalid path: {$_POST['path']}"; } else { $stmt = $db->prepare('INSERT INTO path (path) VALUES (?)'); $stmt->execute(array($_POST['path'])); $msg = 'Path added'; } } $rows = $db->query('SELECT * FROM path')->fetchAll(); ?>